Browse Source

Moved to the switch syntax

environments/development/deployments/31
Drew Short 7 years ago
parent
commit
0c7e29054f
  1. 17
      src/spm/spm.moon

17
src/spm/spm.moon

@ -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"
switch args[1]
when "list"
printPackages(listPackages(args[2]))
when "info"
provideInfo(args[2])
elseif args[1] == "install" or args[1] == "add"
when "install" or "add"
installPackage(args[2], args[3], false)
elseif args[1] == "update" or args[1] == "upgrade"
when "update" or "upgrade"
updatePackage(args[2])
elseif args[1] == "uninstall" or args[1] == "remove"
when "uninstall" or "remove"
uninstallPackage(args[2])
elseif args[1] == "copy"
when "copy"
copyPackage(args[2], args[3])
else
printUsage()
return
Loading…
Cancel
Save