Skip to content

Commit

Permalink
fix shed-version - to source from lib
Browse files Browse the repository at this point in the history
  • Loading branch information
siakhooi committed Apr 23, 2024
1 parent daecb5f commit d0209ba
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 23 deletions.
4 changes: 2 additions & 2 deletions release.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

RELEASE_VERSION=1.23.0
RELEASE_TITLE='add man page - shed-version'
RELEASE_VERSION=1.23.1
RELEASE_TITLE='fix shed-version - to source from lib'

REGISTRY_USERNAME_DOCKER=siakhooi
2 changes: 1 addition & 1 deletion scripts/set-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ set -e
. ./release.env

sed -i 'src/DEBIAN/control' -e 's@Version: .*@Version: '$RELEASE_VERSION'@g'
sed -i 'src/lib/shed-init' -e 's@export SHED_VERSION=.*@export SHED_VERSION='$RELEASE_VERSION'@g'
sed -i 'src/lib/shed-version' -e 's@export SHED_VERSION=.*@export SHED_VERSION='$RELEASE_VERSION'@g'
2 changes: 1 addition & 1 deletion src/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: siakhooi-shed
Version: 1.23.0
Version: 1.23.1
Maintainer: Siak Hooi <[email protected]>
Depends: bash, coreutils, findutils, grep, vim, man-db, sed, siakhooi-devutils-echo-colors (>= 1.0.0), git, siakhooi-textutils (>= 1.7.0), bash-completion, jq
Architecture: amd64
Expand Down
3 changes: 3 additions & 0 deletions src/bin/shed-version
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/bin/bash

# shellcheck source=/dev/null
source '/usr/lib/shed/shed-version'

echo "shed version: $SHED_VERSION"
1 change: 0 additions & 1 deletion src/lib/shed-init
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash

export SHED_VERSION=1.23.0
export SHED_CONFIG_HOME="${SHED_CONFIG_HOME:-$HOME/.shed}"
export SHED_CONFIG_FILE=${SHED_CONFIG_HOME}/config.yaml
export SHED_CONFIG_DIRECTORY_RESOURCES=$SHED_CONFIG_HOME/kubectl-resources
Expand Down
3 changes: 3 additions & 0 deletions src/lib/shed-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

export SHED_VERSION=1.23.1
3 changes: 1 addition & 2 deletions tests/bats-test-scripts/shed-env/shed-env-c1.expected
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ SHED_CODE=D
SHED_CONFIG_DIRECTORY_RESOURCES=/root/.shed/kubectl-resources
SHED_CONFIG_FILE=/root/.shed/config.yaml
SHED_CONFIG_HOME=/root/.shed
SHED_KUBECONFIG_NUMBER=1
SHED_VERSION=.*
SHED_KUBECONFIG_NUMBER=1
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ SHED_CODE=T
SHED_CONFIG_DIRECTORY_RESOURCES=/root/.shed/kubectl-resources
SHED_CONFIG_FILE=/root/.shed/config.yaml
SHED_CONFIG_HOME=/root/.shed
SHED_KUBECONFIG_NUMBER=0
SHED_VERSION=.*
SHED_KUBECONFIG_NUMBER=0
12 changes: 6 additions & 6 deletions tests/bats-test-scripts/shed-env/shed-env.bats
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@ setup(){
}
@test "shed-env" {
run shed-env
cat_expected "shed-env" | assert_output -e -
cat_expected "shed-env" | assert_output -
}
@test "shed-env xxx" {
run shed-env xxx
cat_expected "shed-env" | assert_output -e -
cat_expected "shed-env" | assert_output -
}
@test "shed-use T; shed-env" {
shed-use T
run shed-env
cat_expected "shed-env-shed-use-T" | assert_output -e -
cat_expected "shed-env-shed-use-T" | assert_output -
}
@test "shed-kubeconfig-use 1; shed-env" {
shed-kubeconfig-use 1
run shed-env
cat_expected "shed-env-c1" | assert_output -e -
cat_expected "shed-env-c1" | assert_output -
}
@test "c1; shed-env" {
run bash -ic 'c1; shed-env'
cat_expected "shed-env-c1" | assert_output -e -
cat_expected "shed-env-c1" | assert_output -
}
@test "bash -ic 'bash -ic shed-env'" {
run bash -ic 'bash -ic shed-env'
cat_expected "shed-env" | assert_output -e -
cat_expected "shed-env" | assert_output -
}
3 changes: 1 addition & 2 deletions tests/bats-test-scripts/shed-env/shed-env.expected
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ SHED_CODE=D
SHED_CONFIG_DIRECTORY_RESOURCES=/root/.shed/kubectl-resources
SHED_CONFIG_FILE=/root/.shed/config.yaml
SHED_CONFIG_HOME=/root/.shed
SHED_KUBECONFIG_NUMBER=0
SHED_VERSION=.*
SHED_KUBECONFIG_NUMBER=0
12 changes: 6 additions & 6 deletions tests/bats-test-scripts/shed-env/shed_env.bats
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@ setup(){
}
@test "shed env" {
run shed env
cat_expected "shed-env" | assert_output -e -
cat_expected "shed-env" | assert_output -
}
@test "shed env xxx" {
run shed env xxx
cat_expected "shed-env" | assert_output -e -
cat_expected "shed-env" | assert_output -
}
@test "shed-use T; shed env" {
shed-use T
run shed env
cat_expected "shed-env-shed-use-T" | assert_output -e -
cat_expected "shed-env-shed-use-T" | assert_output -
}
@test "shed-kubeconfig-use 1; shed env" {
shed-kubeconfig-use 1
run shed env
cat_expected "shed-env-c1" | assert_output -e -
cat_expected "shed-env-c1" | assert_output -
}
@test "c1; shed env" {
run bash -i -c 'c1; shed env'
cat_expected "shed-env-c1" | assert_output -e -
cat_expected "shed-env-c1" | assert_output -
}
@test "bash -ic 'bash -ic \"shed env\"'" {
run bash -ic 'bash -ic "shed env"'
cat_expected "shed-env" | assert_output -e -
cat_expected "shed-env" | assert_output -
}

0 comments on commit d0209ba

Please sign in to comment.