mirror of
https://github.com/fsquillace/junest.git
synced 2026-07-25 11:53:56 +00:00
Issue #58: Fix the command execution under CLI
This commit is contained in:
parent
166a629086
commit
8d9dda2453
2 changed files with 12 additions and 1 deletions
|
|
@ -190,7 +190,7 @@ function _run_juju_with_proot(){
|
|||
|
||||
if [ "$1" != "" ]
|
||||
then
|
||||
_run_proot "${proot_args}" "${@}"
|
||||
insert_quotes "${@}" | _run_proot "${proot_args}" "${SH[@]}"
|
||||
else
|
||||
_run_proot "${proot_args}" "${SH[@]}"
|
||||
fi
|
||||
|
|
|
|||
11
lib/util.sh
11
lib/util.sh
|
|
@ -67,3 +67,14 @@ function ask(){
|
|||
fi
|
||||
|
||||
}
|
||||
|
||||
function insert_quotes(){
|
||||
# It inserts quotes between arguments.
|
||||
# Useful to preserve quotes on command
|
||||
# to be used inside sh -c/bash -c
|
||||
C=''
|
||||
for i in "$@"; do
|
||||
C="$C \"${i//\"/\\\"}\""
|
||||
done
|
||||
echo ${C}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue