Skip to content

Commit d2412b1

Browse files
committed
feat: move v2 tool tests to new test function
1 parent d3bcf89 commit d2412b1

File tree

15 files changed

+48
-22
lines changed

15 files changed

+48
-22
lines changed

src/usr/local/containerbase/tools/v2/elixir.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ function link_tool () {
6767
shell_wrapper "${TOOL_NAME}" "${versioned_tool_path}/bin"
6868
shell_wrapper mix "${versioned_tool_path}/bin"
6969

70-
[[ -n $SKIP_VERSION ]] || elixir --version
71-
[[ -n $SKIP_VERSION ]] || mix --version
70+
elixir --version
71+
mix --version
7272

7373
if [[ $(is_root) -eq 0 ]]; then
7474
su -c 'mix local.hex --force' "${USER_NAME}"

src/usr/local/containerbase/tools/v2/erlang.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,5 @@ function link_tool () {
9797
# only works for v24+
9898
#export_tool_env ERL_ROOTDIR "${versioned_tool_path}"
9999
shell_wrapper erl "${versioned_tool_path}/bin"
100-
[[ -n $SKIP_VERSION ]] || erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell
100+
erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell
101101
}

src/usr/local/containerbase/tools/v2/git-lfs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function install_tool () {
3535
function link_tool () {
3636
shell_wrapper "${TOOL_NAME}" "$(find_versioned_tool_path)/bin"
3737

38-
[[ -n $SKIP_VERSION ]] || git lfs version
38+
git lfs version
3939

4040
if [ "$(is_root)" -eq 0 ]; then
4141
git lfs install --system

src/usr/local/containerbase/tools/v2/golang.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ function link_tool () {
100100
versioned_tool_path=$(find_versioned_tool_path)
101101

102102
shell_wrapper go "${versioned_tool_path}/bin" "GOBIN=\${GOBIN-${BIN_DIR}}"
103+
}
103104

104-
[[ -n $SKIP_VERSION ]] || go version
105-
[[ -n $SKIP_VERSION ]] || go env
105+
function test_tool () {
106+
go version
107+
go env
106108
}

src/usr/local/containerbase/tools/v2/jb.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,8 @@ function link_tool () {
2121
versioned_tool_path=$(find_versioned_tool_path)
2222

2323
shell_wrapper "${TOOL_NAME}" "${versioned_tool_path}/bin"
24-
[[ -n $SKIP_VERSION ]] || jb --version
24+
}
25+
26+
function test_tool () {
27+
jb --version
2528
}

src/usr/local/containerbase/tools/v2/nix.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,8 @@ function link_tool() {
3636
versioned_tool_path=$(find_versioned_tool_path)
3737

3838
shell_wrapper "${TOOL_NAME}" "${versioned_tool_path}/bin" "NIX_STORE_DIR=$(get_cache_path)/nix/store NIX_DATA_DIR=$(get_cache_path)/nix/data NIX_LOG_DIR=$(get_cache_path)/nix/log NIX_STATE_DIR=$(get_cache_path)/nix/state NIX_CONF_DIR=$(get_cache_path)/nix/conf"
39-
[[ -n $SKIP_VERSION ]] || nix --version
39+
}
40+
41+
function test_tool () {
42+
nix --version
4043
}

src/usr/local/containerbase/tools/v2/powershell.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,8 @@ function install_tool () {
3838

3939
function link_tool () {
4040
shell_wrapper pwsh "$(find_versioned_tool_path)"
41-
[[ -n $SKIP_VERSION ]] || pwsh -version
41+
}
42+
43+
function test_tool () {
44+
pwsh -version
4245
}

src/usr/local/containerbase/tools/v2/python.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ function link_tool () {
126126
shell_wrapper pip "${versioned_tool_path}/bin"
127127
shell_wrapper "pip${MAJOR}" "${versioned_tool_path}/bin"
128128
shell_wrapper "pip${MAJOR}.${MINOR}" "${versioned_tool_path}/bin"
129+
}
129130

130-
[[ -n $SKIP_VERSION ]] || python --version
131-
[[ -n $SKIP_VERSION ]] || PYTHONWARNINGS=ignore pip --version
131+
function test_tool () {
132+
python --version
133+
PYTHONWARNINGS=ignore pip --version
132134
}

src/usr/local/containerbase/tools/v2/ruby.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,10 @@ function link_tool () {
138138

139139
shell_wrapper ruby "${versioned_tool_path}/bin"
140140
shell_wrapper gem "${versioned_tool_path}/bin"
141+
}
141142

142-
[[ -n $SKIP_VERSION ]] || ruby --version
143-
[[ -n $SKIP_VERSION ]] || echo "gem $(gem --version)"
144-
[[ -n $SKIP_VERSION ]] || gem env
143+
function test_tool () {
144+
ruby --version
145+
echo "gem $(gem --version)"
146+
gem env
145147
}

src/usr/local/containerbase/tools/v2/rust.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ function link_tool () {
7474

7575
shell_wrapper "cargo" "${versioned_tool_path}/bin"
7676
shell_wrapper "rustc" "${versioned_tool_path}/bin"
77+
}
7778

78-
[[ -n $SKIP_VERSION ]] || cargo --version
79-
[[ -n $SKIP_VERSION ]] || rustc --version
79+
function test_tool () {
80+
cargo --version
81+
rustc --version
8082
}

0 commit comments

Comments
 (0)