Skip to content

Commit

Permalink
refactor: split var path
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice committed Aug 1, 2024
1 parent feb0233 commit 8c94eea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/usr/local/containerbase/utils/constants.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export TEMP_DIR=/tmp
# used to source helper from tools
export CONTAINERBASE_DIR=/usr/local/containerbase

export TOOL_PREP_DIR=/var/lib/containerbase/tool.prep.d
export CONTAINERBASE_VAR_DIR=/var/lib/containerbase

# Used to find matching tool downloads
ARCHITECTURE=$(uname -p)
Expand Down
7 changes: 6 additions & 1 deletion src/usr/local/containerbase/utils/filesystem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,14 @@ function get_containerbase_path () {
echo "${CONTAINERBASE_DIR}"
}

# Gets the path to the var folder to persist prepared tools state
function get_containerbase_var_path () {
echo "${CONTAINERBASE_VAR_DIR}"
}

# Gets the path to the cache folder
function get_tool_prep_path () {
echo "${TOOL_PREP_DIR}"
echo "$(get_containerbase_var_path)/tool.prep.d"
}

function set_tool_prep () {
Expand Down
2 changes: 1 addition & 1 deletion test/bash/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export BIN_DIR="${TEST_ROOT_DIR}/bin"
export LIB_DIR="${TEST_ROOT_DIR}/lib"
export USER_HOME="${TEST_ROOT_DIR}/user"
export ENV_FILE="${TEST_ROOT_DIR}/env"
export TOOL_PREP_DIR="${TEST_ROOT_DIR}/tool.prep.d"
export CONTAINERBASE_VAR_DIR="${TEST_ROOT_DIR}/var"

# set default test user
export TEST_ROOT_USER=1000
Expand Down

0 comments on commit 8c94eea

Please sign in to comment.