diff --git a/src/spm/spm.moon b/src/spm/spm.moon index 1c5ae41..e34325a 100644 --- a/src/spm/spm.moon +++ b/src/spm/spm.moon @@ -344,7 +344,7 @@ installPackage = (requestedPackage, installPath, doUpdate) -> for filePath, requestedInstallPath in pairs(packageInfo.files) installedPath - if string.find(requestedInstallPath, "^//") + if string.find(requestedInstallPath, "^//") localInstalledPath = string.sub(requestedInstallPath, 2) if not fs.exists(localInstalledPath) fs.makeDirectory(localInstalledPath) @@ -475,19 +475,18 @@ updatePackage = (requestedPackage) -> else installPackage(args[2], nil, true) -if args[1] == "list" - tPacks = listPackages(args[2]) - printPackages(tPacks) -elseif args[1] == "info" - provideInfo(args[2]) -elseif args[1] == "install" or args[1] == "add" - installPackage(args[2], args[3], false) -elseif args[1] == "update" or args[1] == "upgrade" - updatePackage(args[2]) -elseif args[1] == "uninstall" or args[1] == "remove" - uninstallPackage(args[2]) -elseif args[1] == "copy" - copyPackage(args[2], args[3]) -else - printUsage() - return \ No newline at end of file +switch args[1] + when "list" + printPackages(listPackages(args[2])) + when "info" + provideInfo(args[2]) + when "install" or "add" + installPackage(args[2], args[3], false) + when "update" or "upgrade" + updatePackage(args[2]) + when "uninstall" or "remove" + uninstallPackage(args[2]) + when "copy" + copyPackage(args[2], args[3]) + else + printUsage() \ No newline at end of file