Merge pull request #111 from opencultureconsulting/109-always-set-orcli-alias-in-run-and-test-commands
always set orcli alias
This commit is contained in:
commit
f52b83896e
20
orcli
20
orcli
|
@ -1584,10 +1584,8 @@ orcli_test_command() {
|
|||
for i in "${!files[@]}"; do
|
||||
set +e # do not exit on failed tests
|
||||
bash -e <(
|
||||
if ! command -v orcli &>/dev/null; then
|
||||
echo "shopt -s expand_aliases"
|
||||
echo "alias orcli=${scriptpath}/orcli"
|
||||
fi
|
||||
echo "shopt -s expand_aliases"
|
||||
echo "alias orcli=${scriptpath}/orcli"
|
||||
awk 1 "${files[$i]}"
|
||||
) &>"$OPENREFINE_TMPDIR/test.log"
|
||||
results+=(${?})
|
||||
|
@ -1877,9 +1875,7 @@ orcli_run_command() {
|
|||
# case 1: interactive mode if stdin is selected but not present
|
||||
bash --rcfile <(
|
||||
cat ~/.bashrc
|
||||
if ! command -v orcli &>/dev/null; then
|
||||
echo "alias orcli=${scriptpath}/orcli"
|
||||
fi
|
||||
echo "alias orcli=${scriptpath}/orcli"
|
||||
interactive
|
||||
) -i </dev/tty
|
||||
exit
|
||||
|
@ -1889,9 +1885,7 @@ orcli_run_command() {
|
|||
# case 2: execute scripts and keep shell running
|
||||
bash --rcfile <(
|
||||
cat ~/.bashrc
|
||||
if ! command -v orcli &>/dev/null; then
|
||||
echo "alias orcli=${scriptpath}/orcli"
|
||||
fi
|
||||
echo "alias orcli=${scriptpath}/orcli"
|
||||
for i in "${!files[@]}"; do
|
||||
log "executing script ${files[$i]}..."
|
||||
awk 1 "${files[$i]}"
|
||||
|
@ -1903,10 +1897,8 @@ orcli_run_command() {
|
|||
for i in "${!files[@]}"; do
|
||||
log "executing script ${files[$i]}..."
|
||||
bash -e <(
|
||||
if ! command -v orcli &>/dev/null; then
|
||||
echo "shopt -s expand_aliases"
|
||||
echo "alias orcli=${scriptpath}/orcli"
|
||||
fi
|
||||
echo "shopt -s expand_aliases"
|
||||
echo "alias orcli=${scriptpath}/orcli"
|
||||
awk 1 "${files[$i]}"
|
||||
)
|
||||
done
|
||||
|
|
|
@ -73,9 +73,7 @@ if [[ ${args[file]} == '-' || ${args[file]} == '"-"' ]]; then
|
|||
# case 1: interactive mode if stdin is selected but not present
|
||||
bash --rcfile <(
|
||||
cat ~/.bashrc
|
||||
if ! command -v orcli &>/dev/null; then
|
||||
echo "alias orcli=${scriptpath}/orcli"
|
||||
fi
|
||||
echo "alias orcli=${scriptpath}/orcli"
|
||||
interactive
|
||||
) -i </dev/tty
|
||||
exit
|
||||
|
@ -85,9 +83,7 @@ if [[ ${args[--interactive]} ]]; then
|
|||
# case 2: execute scripts and keep shell running
|
||||
bash --rcfile <(
|
||||
cat ~/.bashrc
|
||||
if ! command -v orcli &>/dev/null; then
|
||||
echo "alias orcli=${scriptpath}/orcli"
|
||||
fi
|
||||
echo "alias orcli=${scriptpath}/orcli"
|
||||
for i in "${!files[@]}"; do
|
||||
log "executing script ${files[$i]}..."
|
||||
awk 1 "${files[$i]}"
|
||||
|
@ -99,10 +95,8 @@ else
|
|||
for i in "${!files[@]}"; do
|
||||
log "executing script ${files[$i]}..."
|
||||
bash -e <(
|
||||
if ! command -v orcli &>/dev/null; then
|
||||
echo "shopt -s expand_aliases"
|
||||
echo "alias orcli=${scriptpath}/orcli"
|
||||
fi
|
||||
echo "shopt -s expand_aliases"
|
||||
echo "alias orcli=${scriptpath}/orcli"
|
||||
awk 1 "${files[$i]}"
|
||||
)
|
||||
done
|
||||
|
|
|
@ -54,10 +54,8 @@ results=()
|
|||
for i in "${!files[@]}"; do
|
||||
set +e # do not exit on failed tests
|
||||
bash -e <(
|
||||
if ! command -v orcli &>/dev/null; then
|
||||
echo "shopt -s expand_aliases"
|
||||
echo "alias orcli=${scriptpath}/orcli"
|
||||
fi
|
||||
echo "shopt -s expand_aliases"
|
||||
echo "alias orcli=${scriptpath}/orcli"
|
||||
awk 1 "${files[$i]}"
|
||||
) &>"$OPENREFINE_TMPDIR/test.log"
|
||||
results+=(${?})
|
||||
|
|
Loading…
Reference in New Issue