Skip to content

Commit

Permalink
reduce use of eval
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Jefferson committed May 20, 2021
1 parent 86dac32 commit 35241ec
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docker-image-src/4.3/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -496,16 +496,16 @@ fi
# the command is something like: `java ...[lots of java options]... neo4j.mainClass ...[some neo4j options]...`
function get_neo4j_run_cmd {

local cmd="neo4j console --dry-run"
local extraArgs=()

if [ "${EXTENDED_CONF+"yes"}" == "yes" ]; then
cmd="${cmd} --expand-commands"
extraArgs+=("--expand-commands")
fi

if running_as_root; then
eval "gosu neo4j:neo4j ${cmd}"
gosu neo4j:neo4j neo4j console --dry-run "${extraArgs[@]}"
else
eval "${cmd}"
neo4j console --dry-run "${extraArgs[@]}"
fi
}

Expand All @@ -515,5 +515,5 @@ function get_neo4j_run_cmd {
if [ "${cmd}" == "neo4j" ]; then
eval "${exec_cmd} $(get_neo4j_run_cmd)"
else
${exec_cmd} "$@"
${exec_cmd} "$@"
fi

0 comments on commit 35241ec

Please sign in to comment.