not required to create a symlink if it already exists

This commit is contained in:
AJ ONeal 2018-07-28 13:51:30 -06:00
parent e1cfecfefc
commit ae32916177
1 changed files with 2 additions and 2 deletions

View File

@ -237,7 +237,7 @@ Launcher.install = function (things, fn) {
//console.log((stdout||'').trim()); //console.log((stdout||'').trim());
var execstr = launcherstr + "enable " + launchername; var execstr = launcherstr + "enable " + launchername;
exec(execstr, things._execOpts, function (err, stdout, stderr) { exec(execstr, things._execOpts, function (err, stdout, stderr) {
err = Launcher._getError(err, !/Created symlink/i.test(stderr||'')); err = Launcher._getError(err, stderr && !/Created symlink/i.test(stderr) && stderr || '');
if (err) { fn(err); return; } if (err) { fn(err); return; }
//console.log((stdout||'').trim()); //console.log((stdout||'').trim());
var execstr = launcherstr + "restart " + launchername; var execstr = launcherstr + "restart " + launchername;
@ -372,7 +372,7 @@ Launcher.uninstall = function (things, fn) {
var launcherstr = (vars.userspace ? "" : "sudo ") + "systemctl " + (vars.userspace ? "--user " : ""); var launcherstr = (vars.userspace ? "" : "sudo ") + "systemctl " + (vars.userspace ? "--user " : "");
var execstr = launcherstr + "disable " + launchername; var execstr = launcherstr + "disable " + launchername;
exec(execstr, things._execOpts, function (err, stdout, stderr) { exec(execstr, things._execOpts, function (err, stdout, stderr) {
err = Launcher._getError(err, !/Removed symlink /i.test(stderr||'') && stderr || ''); err = Launcher._getError(err, stderr && !/Removed symlink/i.test(stderr) && stderr || '');
if (err) { fn(err); return; } if (err) { fn(err); return; }
//console.log((stdout||'').trim()); //console.log((stdout||'').trim());
var execstr = launcherstr + "stop " + launchername; var execstr = launcherstr + "stop " + launchername;