mirror of
https://github.com/laurent22/joplin.git
synced 2024-11-27 08:21:03 +02:00
Chore: Fixes #9282: Plugin generator fails when updating plugin
This commit is contained in:
parent
206f35ffe5
commit
e760276341
@ -12,17 +12,6 @@ module.exports = class extends Generator {
|
||||
|
||||
this.option('silent');
|
||||
this.option('update');
|
||||
|
||||
// This appears to be deprecated and undocumented
|
||||
// Maybe need this instead?
|
||||
// https://github.com/yeoman/generator/issues/1294#issuecomment-841668595
|
||||
|
||||
// this.option('nodePackageManager', 'npm');
|
||||
|
||||
if (this.options.update) {
|
||||
// When updating, overwrite files without prompting
|
||||
this.conflicter.force = true;
|
||||
}
|
||||
}
|
||||
|
||||
async prompting() {
|
||||
@ -165,6 +154,15 @@ module.exports = class extends Generator {
|
||||
},
|
||||
},
|
||||
);
|
||||
} else if (this.options.update) {
|
||||
this.fs.copy(
|
||||
this.templatePath(file),
|
||||
destFilePath, {
|
||||
process: (sourceBuffer) => {
|
||||
return sourceBuffer.toString();
|
||||
},
|
||||
},
|
||||
);
|
||||
} else {
|
||||
this.fs.copyTpl(
|
||||
this.templatePath(file),
|
||||
|
@ -5,7 +5,7 @@
|
||||
"dist": "webpack --env joplin-plugin-config=buildMain && webpack --env joplin-plugin-config=buildExtraScripts && webpack --env joplin-plugin-config=createArchive",
|
||||
"prepare": "npm run dist",
|
||||
"updateVersion": "webpack --env joplin-plugin-config=updateVersion",
|
||||
"update": "npm install -g generator-joplin && yo joplin --node-package-manager npm --update"
|
||||
"update": "npm install -g generator-joplin && yo joplin --node-package-manager npm --update --force"
|
||||
},
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
Loading…
Reference in New Issue
Block a user