Skip to content

Commit

Permalink
refactor: inlining version
Browse files Browse the repository at this point in the history
  • Loading branch information
DeveloperC286 committed Dec 29, 2021
1 parent f7c7b17 commit 7eabbee
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ conventional-commits-next-version-checking:
- cargo install conventional_commits_next_version
script:
# Get current version.
- CURRENT_VERSION=$(cat zsh-simple-abbreviations.zsh | grep "_ZSH_SIMPLE_ABBREVIATIONS_VERSION" | cut -d "'" -f 2)
- CURRENT_VERSION=$(cat src/zsh-simple-abbreviations | grep "^VERSION" | cut -d "'" -f 2)
# Check current version is in semantic versioning.
- echo "${CURRENT_VERSION}" | grep "^${SEMANTIC_VERSIONING_REGEX}$"
# Get latest tag.
Expand All @@ -60,7 +60,7 @@ version-badge-checking:
image: alpine
script:
# Get current version.
- CURRENT_VERSION=$(cat zsh-simple-abbreviations.zsh | grep "_ZSH_SIMPLE_ABBREVIATIONS_VERSION" | cut -d "'" -f 2)
- CURRENT_VERSION=$(cat src/zsh-simple-abbreviations | grep "^VERSION" | cut -d "'" -f 2)
# Check current version is in semantic versioning.
- echo "${CURRENT_VERSION}" | grep "^${SEMANTIC_VERSIONING_REGEX}$"
# Check README version badge and version match.
Expand All @@ -74,7 +74,7 @@ releasing:
image: rust
script:
# Get current version.
- CURRENT_VERSION=$(cat zsh-simple-abbreviations.zsh | grep "_ZSH_SIMPLE_ABBREVIATIONS_VERSION" | cut -d "'" -f 2)
- CURRENT_VERSION=$(cat src/zsh-simple-abbreviations | grep "^VERSION" | cut -d "'" -f 2)
# Check current version is in semantic versioning.
- echo "${CURRENT_VERSION}" | grep "^${SEMANTIC_VERSIONING_REGEX}$"
# If the tag already exist then exit.
Expand Down
3 changes: 2 additions & 1 deletion src/zsh-simple-abbreviations
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env zsh

VERSION='0.2.0'
KEY_REGEX="-_a-zA-Z0-9"

__zsh_simple_abbreviations::expand() {
Expand Down Expand Up @@ -46,7 +47,7 @@ case $1 in
return
fi

echo "${_ZSH_SIMPLE_ABBREVIATIONS_VERSION}"
echo "${VERSION}"
;;
*)
echo "zsh_simple_abbreviations unrecognised sub-command."
Expand Down
2 changes: 0 additions & 2 deletions zsh-simple-abbreviations.zsh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env zsh

if [[ -n $ZSH_VERSION ]]; then
typeset -g _ZSH_SIMPLE_ABBREVIATIONS_VERSION='0.2.0'

# Create new abbreviations map.
typeset -Ag _zsh_simple_abbreviations

Expand Down

0 comments on commit 7eabbee

Please sign in to comment.