From 2e9e36c89da5941e081323fe56ad9ee8a25eecfa Mon Sep 17 00:00:00 2001 From: Teemu Matilainen Date: Wed, 25 Nov 2020 23:02:17 +0200 Subject: [PATCH] Inline version numner to the scripts Duplication, but makes it easier to install the Fish version to be autoloaded. --- chtf/VERSION | 1 - chtf/chtf.fish | 5 ++--- chtf/chtf.sh | 7 +++---- 3 files changed, 5 insertions(+), 8 deletions(-) delete mode 100644 chtf/VERSION diff --git a/chtf/VERSION b/chtf/VERSION deleted file mode 100644 index 1e4ec5e..0000000 --- a/chtf/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.0.1-dev diff --git a/chtf/chtf.fish b/chtf/chtf.fish index 2e4dd7e..8f22d18 100644 --- a/chtf/chtf.fish +++ b/chtf/chtf.fish @@ -21,6 +21,8 @@ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +set -g CHTF_VERSION 2.0.1-dev + # Set defaults set -q CHTF_AUTO_INSTALL; or set -g CHTF_AUTO_INSTALL ask @@ -150,6 +152,3 @@ end function _chtf_root_dir dirname (status --current-filename) end - -# Load and store the version number -set -g CHTF_VERSION (cat (_chtf_root_dir)/VERSION) diff --git a/chtf/chtf.sh b/chtf/chtf.sh index 57f6c48..a8c5430 100644 --- a/chtf/chtf.sh +++ b/chtf/chtf.sh @@ -21,6 +21,8 @@ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +CHTF_VERSION='2.0.1-dev' + # Set defaults : "${CHTF_AUTO_INSTALL:=ask}" @@ -47,7 +49,7 @@ chtf() { echo "usage: chtf [ | system]" ;; -V|--version) - echo "chtf: ${CHTF_VERSION:-[unknown version]}" + echo "chtf: $CHTF_VERSION" ;; "") _chtf_list @@ -181,6 +183,3 @@ _chtf_root_dir() { echo 'chtf: [WARN] Unknown shell' >&2 fi } - -# Load and store the version number -CHTF_VERSION=$(cat "$(_chtf_root_dir)/VERSION")