1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

Chore: Fixes #10306: Remove unnecessary initial commit in default plugins build (#10308)

This commit is contained in:
Henry Heino
2024-04-15 10:14:47 -07:00
committed by GitHub
parent 035557de9f
commit e3ba605592
3 changed files with 32 additions and 19 deletions

View File

@ -8,19 +8,29 @@ import getPathToPatchFileFor from '../utils/getPathToPatchFileFor';
const editPatch = async (targetPluginId: string, outputParentDir: string|null) => {
let patchedPlugin = false;
await buildDefaultPlugins(outputParentDir, async (buildDir, pluginId) => {
if (pluginId !== targetPluginId) {
return;
}
await buildDefaultPlugins(outputParentDir, {
beforePatch: async () => {
// To make updating just the patch possible, a commit is created just before applying
// the patch.
await execCommand('git add .');
await execCommand(['git', 'config', 'user.name', 'Build script']);
await execCommand(['git', 'config', 'user.email', '']);
await execCommand(['git', 'commit', '-m', 'Initial commit']);
},
beforeInstall: async (buildDir, pluginId) => {
if (pluginId !== targetPluginId) {
return;
}
// eslint-disable-next-line no-console
console.log('Make changes to', buildDir, 'to create a patch.');
await waitForCliInput();
await execCommand(['sh', '-c', 'git diff -p > diff.diff']);
// eslint-disable-next-line no-console
console.log('Make changes to', buildDir, 'to create a patch.');
await waitForCliInput();
await execCommand(['sh', '-c', 'git diff -p > diff.diff']);
await copy(join(buildDir, './diff.diff'), getPathToPatchFileFor(pluginId));
await copy(join(buildDir, './diff.diff'), getPathToPatchFileFor(pluginId));
patchedPlugin = true;
patchedPlugin = true;
},
});
if (!patchedPlugin) {