all repos — min @ 54109bf98aa22a69c663104dd75be1bcb93ac54a

A small but practical concatenative programming language.

Renamed removed to uninstall
h3rald h3rald@h3rald.com
Wed, 29 Nov 2023 14:59:24 +0100
commit

54109bf98aa22a69c663104dd75be1bcb93ac54a

parent

3f3149f2f2b715355d01c3d73a0732edb7806cf3

2 files changed, 14 insertions(+), 14 deletions(-)

jump to
M min.nimmin.nim

@@ -143,14 +143,17 @@ Arguments:

filename A $exe file to interpret or compile command A command to execute Commands: - compile <file>.min Compile <file>.min. - eval <string> Evaluate <string> as a min program. - help <symbol|sigil> Print the help contents related to <symbol|sigil>. + compile <file>.min Compile <file>.min. + eval <string> Evaluate <string> as a min program. + help <symbol|sigil> Print the help contents related to <symbol|sigil>. + init Sets up the current directory as a managed min module. + install <module> <version> Install the specified managed min module. + uninstall <module> [<version>] Uninstall the specified managed min module. Options: -a, --asset-path Specify a directory containing the asset files to include in the compiled executable (if -c is set) -d, --dev Enable "development mode" (runtime checks) - -g, --global Execute the specified command (install or remove) globally. + -g, --global Execute the specified command (install or uninstall) globally. -h, --help Print this help -i, --interactive Start $exe shell (with advanced prompt, default if no file specidied)" -j, --interactive-simple Start $exe shell (without advanced prompt)

@@ -274,7 +277,7 @@ except CatchableError:

error getCurrentExceptionMsg() debug getCurrentException().getStackTrace() quit(10) - elif file == "remove": + elif file == "uninstall": if args.len < 2: logging.error "Module name not specified." quit(10)

@@ -284,7 +287,7 @@ if args.len > 2:

version = args[2] try: MMM.setup() - MMM.remove(name, version, GLOBAL) + MMM.uninstall(name, version, GLOBAL) quit(0) except CatchableError: error getCurrentExceptionMsg()

@@ -292,9 +295,6 @@ debug getCurrentException().getStackTrace()

quit(10) elif file == "update": logging.error "[update] Not implemented." - quit(100) - elif file == "info": - logging.error "[info] Not implemented." quit(100) elif file == "search": logging.error "[search] Not implemented."
M minpkg/core/mmm.nimminpkg/core/mmm.nim

@@ -89,7 +89,7 @@ if not dirExists(pwd / "mmm"):

debug "Creating mmm directory" createDir(pwd / "mmm") -proc remove*(MMM: var MinModuleManager, name, version: string, global = false) = +proc uninstall*(MMM: var MinModuleManager, name, version: string, global = false) = var dir: string var versionLabel = version if version == "":

@@ -105,7 +105,7 @@ else:

dir = MMM.localDir / name / version if not dir.dirExists(): raiseError "Module '$#' (version: $#) is not installed." % [name, versionLabel] - notice "Removing module $#@$#..." % [name, versionLabel] + notice "Uninstalling module $#@$#..." % [name, versionLabel] try: dir.removeDir() if version != "" and dir.parentDir().walkDir().toSeq().len == 0:

@@ -113,8 +113,8 @@ # Remove parent directory if no versions are installed

dir.parentDir().removeDir() except CatchableError: debug getCurrentExceptionMsg() - raiseError "Unable to remove module $#@$#" % [name, versionLabel] - notice "Removal complete." + raiseError "Unable to uninstall module $#@$#" % [name, versionLabel] + notice "Uninstall complete." proc install*(MMM: var MinModuleManager, name, version: string, global = false) = var dir: string

@@ -163,7 +163,7 @@ # Rollback

warn "Installation failed - Rolling back..." try: MMM.setup(false) - MMM.remove(name, version, global) + MMM.uninstall(name, version, global) notice "Rollback completed." except: debug getCurrentExceptionMsg()