Merge "Add ui messages about updating or installing each plugin using pgm init"
This commit is contained in:
commit
92ba0dd270
@ -132,9 +132,8 @@ public class InitPlugins implements InitStep {
|
|||||||
|
|
||||||
if (upgrade) {
|
if (upgrade) {
|
||||||
final String installedPluginVersion = getVersion(p);
|
final String installedPluginVersion = getVersion(p);
|
||||||
if (!ui.yesno(upgrade,
|
if (!ui.yesno(upgrade, "%s %s is already installed, overwrite it",
|
||||||
"version %s is already installed, overwrite it",
|
plugin.name, installedPluginVersion)) {
|
||||||
installedPluginVersion)) {
|
|
||||||
Files.deleteIfExists(tmpPlugin);
|
Files.deleteIfExists(tmpPlugin);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -147,6 +146,12 @@ public class InitPlugins implements InitStep {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
Files.move(tmpPlugin, p);
|
Files.move(tmpPlugin, p);
|
||||||
|
if (upgrade) {
|
||||||
|
// or update that is not an upgrade
|
||||||
|
ui.message("Updated %s to %s\n", plugin.name, plugin.version);
|
||||||
|
} else {
|
||||||
|
ui.message("Installed %s %s\n", plugin.name, plugin.version);
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new IOException("Failed to install plugin " + pluginName
|
throw new IOException("Failed to install plugin " + pluginName
|
||||||
+ ": " + tmpPlugin.toAbsolutePath() + " -> "
|
+ ": " + tmpPlugin.toAbsolutePath() + " -> "
|
||||||
|
Loading…
Reference in New Issue
Block a user