Commit Graph

9 Commits

Author SHA1 Message Date
Eric Nielsen a5fb148ccf
Force local zsh emulation options
so the code is not broken by unexpected option changes, like

    setopt RC_EXPAND_PARAM

which breaks

    print -R 'fpath=('${${_zfpaths#${~zpre}}:A}' ${fpath})'

in the _zimfw_build_init function, for example.

See #444.
2021-11-21 14:39:20 -05:00
Eric Nielsen 811616cc60
Add missing `-l` in git tool print_okay
This fixes a regression introduced in commit b1edcf34d0.

Also don't use any option after `-R` just to be safe. The zshbuiltins(1)
manual states:

> Only the -e and -n flags are recognized after -R; all other arguments
> and options are printed.
2021-11-08 11:38:56 -05:00
Eric Nielsen b1edcf34d0
Use `print -l` to print multiple lines
and also remove extra quotes. Still only leave redundant quotes in

    zstyle -s 'context' style 'name'

as that's kind of a convention already.
2021-09-23 14:29:40 -05:00
Eric Nielsen cffd456556
Add new degit tool \o/
and rename previous to git.

Tools allow for different install and update scripts. The git tool does
what the previous implementation did (installs and updates using the git
client). The new tool installs and updates with the GitHub API, not
using the git client, but using curl/wget and tar instead.

Closes #373
2021-04-07 17:54:47 -05:00
Eric Nielsen 163d36b61b
Use Zsh scripting instead of sed, sort and tail
`foo | sed 's?^.*/v??' | sort -n -t. -k1,1 -k2,2 -k3,3 | tail -n1` is
the same as `${${(On)${(f)"$(foo)"}##*v}[1]}`. We don't want to depend
on external tools that might not be available in all platforms.
2021-03-19 18:14:31 -05:00
Eric Nielsen 6129062139
Fail when no modules defined in .zimrc
instead of allowing xargs to execute the action with no positional
parameters.

Also don't try to write to .latest_version if there's no write
permission. This is supposed to be a background/optional operation, so
we don't want to show an error message in this case.

And use Zsh globs instead of find with -exec, and find won't fail if
there's an error with the -exec command.
2020-01-26 15:33:17 -05:00
Eric Nielsen cbf142a988
Fix "no such file or directory" error
before initial check for latest version. Not all versions of Zsh or all
OSs are affected. Error seen with Zsh 5.6.2 running on FreeBSD is:

    _zimfw_version_check:10: no such file or directory: /path/to/.latest_version
2020-01-22 12:48:46 -05:00
Eric Nielsen d096b29cac
v1.1.0
Last-minute minor fixes:
* Delete .latest_version after upgrading. Having a cache brings in these
  complexities.
* Print warning to stderr, to distinguish it from the normal output.
* Update help to be in sync with the README.md.
2020-01-20 07:24:27 -05:00
Eric Nielsen 1341afe525
Optional async check for latest version
every 30 days, storing it in a .latest_version file.

Also allow disabling this with:

    zstyle ':zim' disable-version-check yes
2020-01-16 11:30:09 -05:00