diff options
author | 0neGal <mail@0negal.com> | 2023-07-16 19:11:26 +0200 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2023-07-16 19:11:26 +0200 |
commit | cf83f8fd648dab4eb905ea81dd258160f8b95d33 (patch) | |
tree | 30798c53632e53878dfc3473ca25e35dab50bfdb /src | |
parent | 241f5528c749772b62095bc9b025906f84a68810 (diff) | |
download | Viper-cf83f8fd648dab4eb905ea81dd258160f8b95d33.tar.gz Viper-cf83f8fd648dab4eb905ea81dd258160f8b95d33.zip |
minor changes to packages.install()
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/packages.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/modules/packages.js b/src/modules/packages.js index 4410192..bb610d5 100644 --- a/src/modules/packages.js +++ b/src/modules/packages.js @@ -209,16 +209,19 @@ packages.install = async (url, author, package_name, version) => { } } + // removes older version of package inside the `packages` folder packages.remove(author, package_name, version); console.log("Moving package:", name); let moved = packages.move(package_path); - if (moved) { - console.log("Installed package:", name); - } else { + if (! moved) { console.log("Moving package failed:", name); + return false; } + + console.log("Installed package:", name); + return true; } packages.download = async (url, name) => { |