diff --git a/CHANGELOG.md b/CHANGELOG.md index 367bd7f..19fe6a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,9 +10,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Also list not installed modules with `list` action, when not in verbose mode. -- `auto` tool in `zmodule`, which auto detects the best tool available for installing a new - module or the tool used when an existing module was installed. This is now the default tool - and makes life automatically easier for users without git installed. +- `auto` tool in `zmodule`, which auto detects the best tool available for + installing a new module or the tool used when an existing module was + installed. This is now the default tool and makes life automatically easier + for users without git installed. + +### Fixed + +- Print help or version even if `ZIM_HOME` is not set. +- "no such file or directory: /path/to/.zdegit" error when installing a new + module with the degit tool. ## [1.16.0] - 2024-11-25 diff --git a/LICENSE b/LICENSE index 407120c..0cab509 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ MIT License Copyright (c) 2015-2016 Matt Hamilton and contributors -Copyright (c) 2016-2024 Eric Nielsen, Matt Hamilton and contributors +Copyright (c) 2016-2025 Eric Nielsen, Matt Hamilton and contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index a9f699d..cf12162 100644 --- a/README.md +++ b/README.md @@ -77,14 +77,7 @@ to tweak your [`~/.zshrc`](#set-up-zshrc) file and to also check the available Add the lines below to your `~/.zshrc` file, in the following order: -1. To use our `degit` tool by default to install modules: - ```zsh - zstyle ':zim:zmodule' use 'degit' - ```` - This is optional and only required if you don't have `git` installed (yes, - zimfw works even without `git`!) - -2. To set where the zimfw plugin manager configuration file will be located: +1. To set where the zimfw plugin manager configuration file will be located: ```zsh ZIM_CONFIG_FILE=~/.config/zsh/zimrc ``` @@ -93,7 +86,7 @@ Add the lines below to your `~/.zshrc` file, in the following order: the `ZDOTDIR` environment variable is not defined. Otherwise, it must be at `${ZDOTDIR}/.zimrc`. -3. To set the directory where the zimfw plugin manager will keep necessary files: +2. To set the directory where the zimfw plugin manager will keep necessary files: ```zsh ZIM_HOME=~/.zim ``` @@ -101,7 +94,7 @@ Add the lines below to your `~/.zshrc` file, in the following order: You can even set it to a cache directory like `${XDG_CACHE_HOME}/zim` or `~/.cache/zim`. -4. To automatically download the zimfw plugin manager if missing: +3. To automatically download the zimfw plugin manager if missing: ```zsh # Download zimfw plugin manager if missing. if [[ ! -e ${ZIM_HOME}/zimfw.zsh ]]; then @@ -123,7 +116,7 @@ Add the lines below to your `~/.zshrc` file, in the following order: for example. If you choose to not include this step, you should manually download the `zimfw.zsh` script once and keep it at the preferred path. -5. To automatically install missing modules and update the static initialization +4. To automatically install missing modules and update the static initialization script if missing or outdated: ```zsh # Install missing modules and update ${ZIM_HOME}/init.zsh if missing or outdated. @@ -137,7 +130,7 @@ Add the lines below to your `~/.zshrc` file, in the following order: `zimfw.zsh` in a different path as mentioned in the previous step, replace `${ZIM_HOME}/zimfw.zsh` by the chosen path. -6. To source the static script, that will initialize your modules: +5. To source the static script, that will initialize your modules: ```zsh # Initialize modules. source ${ZIM_HOME}/init.zsh @@ -270,8 +263,11 @@ Per-module options: -t|--tag <tag_name> Use specified tag when installing and updating the module. Over- rides the branch option. -u|--use <tool_name> Install and update the module using the defined tool. Default is - either defined by zstyle ':zim:zmodule' use '<tool_name>', or git - if none is provided. The tools available are: + either defined by zstyle ':zim:zmodule' use '<tool_name>', or + set to auto. The tools available are: + auto tries to auto detect the tool to be used. When installing a + new module, git will be used if the git command is available, + otherwise degit will be used. git uses the git command. Local changes are preserved on updates. degit uses curl or wget, and currently only works with GitHub URLs. Modules install faster and take less disk space. Local @@ -349,8 +345,8 @@ if the `ZDOTDIR` environment variable is not defined. Otherwise, it must be at ZIM_CONFIG_FILE=~/.config/zsh/zimrc -Modules are installed using `git` by default. If you don't have `git` -installed, or if you want to take advantage of our degit tool for faster and +The zimfw plugin manager will detect if `git` is installed and fall back to work without `git` +with its degit tool. If you want to take advantage of its degit tool regardless for faster and lighter module installations, you can set degit as the default tool with: zstyle ':zim:zmodule' use 'degit' diff --git a/src/zimfw.zsh.erb b/src/zimfw.zsh.erb index e9cacf8..9fc34af 100644 --- a/src/zimfw.zsh.erb +++ b/src/zimfw.zsh.erb @@ -4,7 +4,7 @@ class Zim :bold, :normal, :red, :normalred, :yellow, :normalyellow, :clear_line, :ellipsis, :okay, :warn, :error def initialize - @version = "1.17.0-SNAPSHOT" + @version = "1.17.0" @home = "${ZDOTDIR:-${HOME}}" @min_zsh_version = "5.2" # Matches {ssh,http,https,git}://{user@,}host/org/repo and {user@,}host:org/repo diff --git a/zimfw.zsh b/zimfw.zsh index 621f303..e0356b7 100644 --- a/zimfw.zsh +++ b/zimfw.zsh @@ -4,7 +4,7 @@ # MIT License # # Copyright (c) 2015-2016 Matt Hamilton and contributors -# Copyright (c) 2016-2024 Eric Nielsen, Matt Hamilton and contributors +# Copyright (c) 2016-2025 Eric Nielsen, Matt Hamilton and contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -485,7 +485,7 @@ _zimfw_info() { _zimfw_info_print_symlink ZIM_HOME ${ZIM_HOME} _zimfw_info_print_symlink 'zimfw config' ${_zconfig} _zimfw_info_print_symlink 'zimfw script' ${__ZIMFW_FILE} - print -R 'zimfw version: '${_zversion}' (built at 2025-01-16 02:29:49 UTC, previous commit is 913e815)' + print -R 'zimfw version: '${_zversion}' (built at 2025-01-16 14:45:26 UTC, previous commit is 184076e)' local zparam for zparam in LANG ${(Mk)parameters:#LC_*} OSTYPE TERM TERM_PROGRAM TERM_PROGRAM_VERSION ZSH_VERSION; do print -R ${(r.22....:.)zparam}${(P)zparam} @@ -983,7 +983,7 @@ zimfw() { local -r _znormal= _zbold= _zred= _znormalred= _zgreen= _zyellow= _znormalyellow= fi local -r _zerror="${_zred}x " _zokay="${_zgreen}) ${_znormal}" _zwarn="${_zyellow}! " - local -r _zconfig=${ZIM_CONFIG_FILE:-${ZDOTDIR:-${HOME}}/.zimrc} _zversion='1.17.0-SNAPSHOT' + local -r _zconfig=${ZIM_CONFIG_FILE:-${ZDOTDIR:-${HOME}}/.zimrc} _zversion='1.17.0' local -r zusage="Usage: ${_zbold}${0}${_znormal} [${_zbold}-q${_znormal}|${_zbold}-v${_znormal}] Actions: