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
@ -23,6 +23,13 @@ program
|
|||||||
|
|
||||||
const packagesPath = Helper.getPackagesPath();
|
const packagesPath = Helper.getPackagesPath();
|
||||||
const packagesParent = path.dirname(packagesPath);
|
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(
|
const npm = child.spawn(
|
||||||
process.platform === "win32" ? "npm.cmd" : "npm",
|
process.platform === "win32" ? "npm.cmd" : "npm",
|
||||||
@ -59,7 +66,7 @@ program
|
|||||||
if (hasUninstalled) {
|
if (hasUninstalled) {
|
||||||
log.info(`${colors.green(packageName)} has been successfully uninstalled.`);
|
log.info(`${colors.green(packageName)} has been successfully uninstalled.`);
|
||||||
} else {
|
} else {
|
||||||
log.warn(`${colors.green(packageName)} was not installed.`);
|
log.warn(packageWasNotInstalled);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user