mirror of
https://github.com/thelounge/thelounge
synced 2024-11-15 00:37:13 +00:00
Bail when uninstalling if package.json for TL packages does not exist
It is on purpose that the message is the same than when a package was not installed. From a user standpoint, it only matters that this specific package was not installed.
This commit is contained in:
parent
3971ecff63
commit
d2388dc623
1 changed files with 8 additions and 1 deletions
|
@ -23,6 +23,13 @@ program
|
|||
|
||||
const packagesPath = Helper.getPackagesPath();
|
||||
const packagesParent = path.dirname(packagesPath);
|
||||
const packagesConfig = path.join(packagesParent, "package.json");
|
||||
const packageWasNotInstalled = `${colors.green(packageName)} was not installed.`;
|
||||
|
||||
if (!fs.existsSync(packagesConfig)) {
|
||||
log.warn(packageWasNotInstalled);
|
||||
return;
|
||||
}
|
||||
|
||||
const npm = child.spawn(
|
||||
process.platform === "win32" ? "npm.cmd" : "npm",
|
||||
|
@ -59,7 +66,7 @@ program
|
|||
if (hasUninstalled) {
|
||||
log.info(`${colors.green(packageName)} has been successfully uninstalled.`);
|
||||
} else {
|
||||
log.warn(`${colors.green(packageName)} was not installed.`);
|
||||
log.warn(packageWasNotInstalled);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue