Commit Graph

26 Commits

Author SHA1 Message Date
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 b4b9829360
v1.4.3 2021-03-19 18:44:53 -05:00
Eric Nielsen 65783e61ed
Use 2 as exit code for usage errors
See https://tldp.org/LDP/abs/html/exitcodes.html
2021-03-19 17:13:21 -05:00
Eric Nielsen f7c0bbeb36
Prefer the prezto module format
to avoid conflicts when we have Zim modules made to also be compatible
with ohmyzsh, like https://github.com/zimfw/pvenv
We don't want to be affected by the noise a `${module_name}.plugin.zsh`
file creates, as we always want to source `init.zsh` when a module also
has a `functions` subdir. Hope this better protects us from the "wild
west out there".
2021-03-16 17:04:40 -05:00
Eric Nielsen bcae8c0a06
Set default ztype in update.zsh.erb
since we're already setting the default zrev in there too. Leave both
blank in zmodule if they're not set by the user.
2021-01-04 21:20:03 -05:00
Eric Nielsen 3567694a0f
Use repository's default branch
instead of hardcoding the default to `master`, when no branch is
specified in `zmodule`.
Fixes #422
2021-01-02 19:09:52 -05:00
Eric Nielsen c6f0720abc
Fail when no parameter is provided to `-c|--cmd`
Forgot to add this check when the new option was introduced.
2020-11-07 14:42:04 -05:00
Eric Nielsen ef4fe38716
Narrow zmodule help text
to avoid the horizontal scroll on it in the https://github.com/zimfw/zimfw
GitHub homepage.
2020-10-11 12:24:01 -05:00
Eric Nielsen dc93d13903
v1.3.0 2020-07-05 09:36:21 -05:00
Eric Nielsen 9b02b41f47
Add `-c|--cmd` option to `zmodule`
so freely defined commands can be executed.

Fixes #405
2020-07-02 17:16:44 -05:00
Eric Nielsen 99e6b31891
Init and compile local modules in their directories
instead of requiring that they're installed inside ZIM_HOME.

Fixes #399
2020-06-09 21:34:21 -05:00
Eric Nielsen c0d786229c
Warning when no initialization found in a module
Some plugins don't follow the `module_name.plugin.zsh` name, as "it is
the wild west out there".

Fixes #395
2020-05-25 14:01:00 -05:00
Eric Nielsen 8724686e85
Don't depend on `cmp` and `xargs`
as they requires busybox or diffutils and findutils.
Use `cksum` and `zargs` instead.

Fixes #393
2020-05-16 20:22:22 -05:00
Eric Nielsen 7e369ef9cf
Update zmodule usage text
Hopefully the README.md will look aesthetically better with a pre block
instead of switching between text and `code`.
2020-05-02 18:47:38 -05:00
Marko Vujanic d1103f34e5
Improve error message when module not installed
Closes #390
2020-05-02 17:50:34 -05:00
Eric Nielsen b3c7fde730
Use short `if` form instead of `&&`
See
http://zsh.sourceforge.net/Doc/Release/Shell-Grammar.html#Alternate-Forms-For-Complex-Commands
2020-02-03 20:49:52 -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 be2be83560
Check the latest version using `git ls-remote`
which is being used to list the latest tag starting with `v`.
Print a warning if it's different than the current version being used.
2020-01-13 13:14:31 -05:00
Eric Nielsen ee99fe8a36
Add `-v` (verbose) option
so the normal output is focused on the given action, and output for
additional steps perfomed after the given action is only shown in
verbose mode.

Also, the output of wget is only shown in verbose mode. This is because
wget always shows some output (to stderr) even when there are no errors.
See https://serverfault.com/q/70889/302338

This should give a friendlier output.
See #360
2020-01-11 16:34:36 -05:00
Eric Nielsen 0b19b2f89a
Update README.md and zimfw output
due to latest changes on how Zim works.
2020-01-02 12:58:04 -05:00
Eric Nielsen 5587ea14da
Update autoload functions glob
based on glob used in Prezto:
https://github.com/sorin-ionescu/prezto/blob/1bc0da5f48init.zsh#L79
and in compinit:
https://github.com/zsh-users/zsh/blob/b816291a17/Completion/compinit#L499
2020-01-02 12:58:04 -05:00
Eric Nielsen 93bbc35634
Use ASCII characters only
we want to be a universal Zsh framework, and send the message that
"less is less"!  ;- )

Don't indent done and failed messages with an indicator, at the end of
actions, to differentiate them from intermediate okay and error messages.
2020-01-02 12:58:03 -05:00
Eric Nielsen 4b750cb72f
Fix zimfw failing in termux with NO_CASE_GLOB
that is set by the completion module.
This is a known still unsolved issue with termux.
See https://github.com/termux/termux-packages/issues/1894
2020-01-02 12:58:03 -05:00
Eric Nielsen cec82ea0e5
Add zimfw init action for a quick build
Having to manually do `zimfw build` every time after you edit your
.zimrc file is boring. So by having the following in .zshrc before
sourcing init.zsh will do a quick build automatically when needed:

    if [[ ~/.zim/init.zsh -ot ~/.zimrc ]]; then
      source ~/.zim/zimfw.zsh init -q
    fi
2020-01-02 12:58:02 -05:00
Eric Nielsen a227f134a5
Source .zimrc twice when installing/updating
Once before installing/updating to prepare _zmodule_xargs, and once
after modules are updated, so functions and scripts can be found inside
them. Installation of Zim from scratch was failing because all modules
are empty at first.
2020-01-02 12:58:01 -05:00
Eric Nielsen dfe35e1bfa
Generate static init.zsh script \o/
to autoloads the functions and sources the scripts, instead of executing
zimfw during startup, and having it always figuring out what do to on
the fly.

This takes out the worry about zimfw interfering with the startup time,
and allows room to add more features to it. So, zstyle was replaced by a
custom zmodule function to define the modules, with the extra ability of
allowing users to set custom fpath paths, autoloaded functions and
sourced scripts per module.
2020-01-02 12:58:01 -05:00