Commit Graph

6 Commits

Author SHA1 Message Date
Eric Nielsen c86223f473
Don't use tar --strip
as it's not compatible with BSD distributions.
Fixes #534
2024-04-28 14:06:24 -05:00
Eric Nielsen 2e9256a567
Add new mkdir tool to generate empty modules
This will allow creating modules that contain only externally generated
files. For example, this is how I currently use it to generate modules
for code that is supposed to be eval'ed:

    zmodule-eval() {
      local -r zcommand=${${=1}[1]} ztarget=${1//[^[:alnum:]]/-}.zsh
      zmodule custom-${zcommand} --use mkdir --if-command ${zcommand} \
          --cmd "if [[ ! {}/${ztarget} -nt \${commands[${zcommand}]} ]]; then ${1} >! {}/${ztarget}; zcompile -UR {}/${ztarget}; fi" \
          --source ${ztarget}
    }
    zmodule-eval 'starship init zsh'
    unfunction zmodule-eval
2024-02-16 20:41:29 -05:00
Eric Nielsen 26151d2f54
Remove prompt expansion from print statements
and replace the foreground color and bold expansions by ANSI escape
codes. This should make the print calls now safe and no expansion at all
should happen as we're using `-R` -- unless the `-e` flag is given.
Fixes #521. Closes #522
2023-09-16 13:21:14 -05:00
Eric Nielsen 0566b9b8a3
Use _zimfw_print 2023-06-15 09:33:14 -05:00
Eric Nielsen f93e43e8a5
Tools run in a subshell 2023-03-31 20:34:26 -05:00
Eric Nielsen ee93f7944f
Don't use a new shell to run tool anymore
This was needed when we were using xargs, but we're already using zargs
instead for quite some time. Pro is that now common functions are reused
instead of repeated. Con (or change) is that due to that reuse, and in
favor of simplification, the warning for a module with git submodules in
degit is in a separate line from a separate print call now.

Also fix regressions from recent commits:
- Need to call _zimfw_source_zimrc twice with 1 and 2 flags instead of
  with flag 3, since flag 2 must be used after module is installed or
  updated.
- Need to call _zimfw_print_okay from the function that handles on-pull,
  since we want to include the on-pull output in verbose mode. This
  function was called just `handle` before, now it's called
  _zimfw_pull_print_okay.

Still need to figure out how to return a final error code from
_zimfw_run_tool_action.
2023-03-28 07:56:37 -05:00