Skip to content

Commit

Permalink
Inline version numner to the scripts
Browse files Browse the repository at this point in the history
Duplication, but makes it easier to install the Fish version to be
autoloaded.
  • Loading branch information
tmatilai committed Nov 25, 2020
1 parent 8cc88ad commit 2e9e36c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion chtf/VERSION

This file was deleted.

5 changes: 2 additions & 3 deletions chtf/chtf.fish
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
7 changes: 3 additions & 4 deletions chtf/chtf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -47,7 +49,7 @@ chtf() {
echo "usage: chtf [<version> | system]"
;;
-V|--version)
echo "chtf: ${CHTF_VERSION:-[unknown version]}"
echo "chtf: $CHTF_VERSION"
;;
"")
_chtf_list
Expand Down Expand Up @@ -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")

0 comments on commit 2e9e36c

Please sign in to comment.