mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-06 10:59:22 +00:00
fix(dfm): update traps and tests (#124)
* fix(dfm): update traps and tests * fix(dfm): initialize defaults and secure tests * fix(tests): secure helper quoting and extend install coverage * fix(utils): avoid double extension when resolving command * fix(tests): quote paths and add strict mode * fix(utils): escape function name in regex
This commit is contained in:
17
tests/dfm/helpers.bash
Normal file
17
tests/dfm/helpers.bash
Normal file
@@ -0,0 +1,17 @@
|
||||
run_with_dfm() {
|
||||
local cmd="$*"
|
||||
run env \
|
||||
PROJECT_ROOT="$PROJECT_ROOT" \
|
||||
DFM_CMD_DIR="$PROJECT_ROOT/local/dfm/cmd" \
|
||||
DFM_LIB_DIR="$PROJECT_ROOT/local/dfm/lib" \
|
||||
DOTFILES="${DOTFILES:-$PROJECT_ROOT}" \
|
||||
NO_AUTOMATION="${NO_AUTOMATION:-1}" \
|
||||
TEMP_DIR="$TEMP_DIR" \
|
||||
bash -c 'set -e
|
||||
cmd="$1"
|
||||
source "$PROJECT_ROOT/local/dfm/lib/common.sh"
|
||||
source "$PROJECT_ROOT/local/dfm/lib/utils.sh"
|
||||
set +e
|
||||
eval "$cmd"' bash "$cmd"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user