mirror of
https://github.com/kanidm/kanidm.git
synced 2025-05-22 00:43:54 +02:00
replace pushd/popd with shell agnostic solution
This commit is contained in:
parent
5fb2173d93
commit
9e32d353a4
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
|
@ -29,7 +29,9 @@ if [ ! -f "${CONFIG_FILE}" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
pushd "${SCRIPT_DIR}" > /dev/null 2>&1
|
||||
# Save current directory and change to script directory without pushd
|
||||
OLD_DIR=$(pwd)
|
||||
cd "${SCRIPT_DIR}" > /dev/null 2>&1
|
||||
if [ -n "${1}" ]; then
|
||||
COMMAND=$*
|
||||
#shellcheck disable=SC2086
|
||||
|
@ -40,4 +42,4 @@ else
|
|||
#shellcheck disable=SC2086
|
||||
cargo run ${KANI_CARGO_OPTS} --bin kanidmd -- server -c "${CONFIG_FILE}"
|
||||
fi
|
||||
popd > /dev/null 2>&1
|
||||
cd $OLD_DIR > /dev/null 2>&1
|
||||
|
|
Loading…
Reference in a new issue