Skip to content

Commit

Permalink
safeguard rm command
Browse files Browse the repository at this point in the history
  • Loading branch information
cmuench committed Sep 25, 2023
1 parent c68f18a commit 09289dd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/bats/functional_magerun_commands.bats
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ setup() {
load 'test_helper/bats-support/load'
load 'test_helper/bats-assert/load'

declare PHP_BIN
PHP_BIN=$(which php)
if [ $? -ne 0 ]; then
echo "Error: PHP binary not found"
exit 1
fi

if [ -z "$PHP_BIN" ]; then
export PHP_BIN="$(which php)"
fi
Expand All @@ -23,7 +30,7 @@ setup() {
}

function cleanup_files_in_magento() {
rm -Rf "${N98_MAGERUN2_TEST_MAGENTO_ROOT}/$1"
rm -Rf "${N98_MAGERUN2_TEST_MAGENTO_ROOT:?}/$1"
}

@test "Command: admin:user:list" {
Expand Down

0 comments on commit 09289dd

Please sign in to comment.