(38 lines)
1 #!/usr/bin/env nomsu -V7.0.02 ###3 A tool to uninstall third party Nomsu packages (the inverse of the install tool)5 Usage:6 nomsu -t uninstall <package_names...>8 use "filesystem"9 use "commandline"10 use "shell"12 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~14 (run command $cmd) means:15 say $cmd16 try:17 sh> $cmd18 ..if it fails:19 say ("20 Sorry, the uninstall failed. You may need to re-run as root with `sudo` in front of the command.21 ")22 exit 124 command line program with $args:25 $searchpath =26 [:27 for $ in ["?.lua", "?/init.lua", "?.nom", "?/init.nom"]:28 add "\$(NOMSU PACKAGEPATH)\$"29 ], joined with ";"31 for $package_name in $args.extras:32 $path = ($package.searchpath $package_name $package.nomsupath "/")33 unless $path:34 say "Sorry, couldn't find \$package_name in \$(NOMSU PACKAGEPATH)"35 exit 136 $path = ($path, with "/init%.nom" -> "")37 unless ((ask "Do you want to delete \($path)? [Y/n] ") == "n"):38 run command "rm -rv \$path"