Skip to content

Commit

Permalink
Plugin state locations containing paths were not handled properly. (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
ams-tschoening authored Feb 8, 2020
1 parent 7de06ad commit 5b98195
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,17 @@

public class GemHelper {

private static String buildGemCmd(String cmd, String gem) {
return String.format(
"gem %s -V -n \"%s\" %s",
cmd, getPluginStateLocation(), gem.toLowerCase()
);
}

public static void install(String gem, StringPreferences pathPreference) {
String pluginStateLocation = getPluginStateLocation();
String[] command = CommandHelper
.getPlatformCommand("gem install -V " + "-n " + pluginStateLocation + " " + gem.toLowerCase());
String[] command = CommandHelper.getPlatformCommand(buildGemCmd("install", gem));
CommandJob installCommandJob = new CommandJob(gem, command, "Installation in progress");

installCommandJob.addJobChangeListener(new JobChangeAdapter() {

@Override
Expand All @@ -51,8 +57,7 @@ public void done(IJobChangeEvent event) {
}

public static void scheduleUpdate(String gem, long delay) {
String[] command = CommandHelper
.getPlatformCommand("gem update -V " + "-n " + getPluginStateLocation() + " " + gem.toLowerCase());
String[] command = CommandHelper.getPlatformCommand(buildGemCmd("update", gem));
new CommandJob(gem, command, "Update in progress").schedule(delay);
}

Expand Down

0 comments on commit 5b98195

Please sign in to comment.