Commit Graph

14 Commits

Author SHA1 Message Date
Eric Nielsen 6d577d7f6a
Fix update.zsh.erb for renamed HEAD remote branch
We need to fetch all branches first to handle the scenario when the HEAD
remote branch was renamed. Recently repositories started changing their
HEAD branch names from master to main.
Fixes #424
2021-02-19 15:30:27 -05:00
Eric Nielsen 12dab4e893
Fix getting HEAD remote branch in update.zsh.erb
instead of getting just the current local branch.
2021-02-17 17:51:22 -05:00
Eric Nielsen 36aa1b3fe9
Fix getting default branch in update.zsh.erb
The regression was introduced in commit 3567694. I wrongly assumed that
`git fetch -pq origin HEAD` would fetch from the remote default branch.
Fixes #423
2021-02-17 15:55:38 -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
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 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 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 3ae4fec895
Use builtin cd -q
to bypass aliases and to avoid calling any chpwd hook functions.
2020-01-02 12:58:03 -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
Eric Nielsen 109279fc59
Indent git log in zimfw update 2020-01-02 12:58:01 -05:00
Eric Nielsen e7ba68511a
Fix git log in zimfw update not showing backtick
because it was being processed as the beginning of a escape sequence.
Using `print -R` fixes that. Probably a good idea to use it when
printing other messages that contain externally-generated output.
2020-01-02 12:58:01 -05:00
Eric Nielsen 1980ca091d
Zim script in a single file \o/
Also moved the templates out of this repository, and into the
zimfw/install repo.

This is a second big change after introducing the plugin mechanism. This
makes installation and upgrading of Zim straightforward. Maybe the most
important aspect of having the script in a single file is not having to
manage "git repos inside git repos" (see #297), since the single file
exists by itself and is not version-controlled (with git).

I've implemented a two-stage sourcing of the file, so most of the file
is only sourced when needed (namely when calling `zimfw` with any action
other than `login-init`). The two-stage process is designed to avoid
compromising the startup speed, which is our top priority.

In an effort to help making the script maintainable, I've broken it into
small ERB templates. This also adds the ability to pre-process the Zsh
code with Ruby code. To build the script, use `make`.
2020-01-02 12:58:01 -05:00
Renamed from tools/update.zsh (Browse further)