Alphanet/Zeronet: fix usage of external file

This commit is contained in:
Grégoire Henry 2018-04-18 16:09:23 +02:00
parent 3ceaed4dd3
commit f6e0fdfdf5

View File

@ -352,25 +352,22 @@ stop_endorser() {
run_client() { run_client() {
assert_node_uptodate assert_node_uptodate
declare -a container_args=(); declare -a container_args=();
tmpdir=$(exec_docker mktemp) tmpdir="/tmp"
for arg in "$@"; do for arg in "$@"; do
if [[ "$arg" == 'container:'* ]]; then if [[ "$arg" == 'container:'* ]]; then
local_path="${arg#container:}" local_path="${arg#container:}"
if [[ "$local_path" != '/'* ]]; then if [[ "$local_path" != '/'* ]]; then
local_path="$current_dir/$local_path" local_path="$current_dir/$local_path"
fi fi
docker exec "$docker_container" mkdir -p -m 777 "$tmpdir"
file_name=$(basename "${local_path}") file_name=$(basename "${local_path}")
docker_path="$tmpdir/$file_name" docker_path="$tmpdir/$file_name"
docker cp "${local_path}" "$docker_node_container:${docker_path}" docker cp "${local_path}" "$docker_node_container:${docker_path}"
exec_docker chmod 644 "${docker_path}" container_args+=("$docker_path");
container_args+=("file:$docker_path");
else else
container_args+=("${arg}"); container_args+=("${arg}");
fi fi
done done
exec_docker tezos-client "${container_args[@]}" exec_docker tezos-client "${container_args[@]}"
exec_docker rm -rf $tmpdir # Remove copied files
} }
run_shell() { run_shell() {