Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Makes config copying idempotent
Browse files Browse the repository at this point in the history
Given we have following paths:

/bin/ # directory
/scripts/config/my/con/fig.conf

When we are copying directory via `cp -a foo/script/config /bin/config`
We get new file with following path:

/bin/config/my/con/fig.conf

But if we run that script again when '/bin/config/` is already present
we would get another file with path:

/bin/config/config/my/con/fig.conf

This commit makes second and consecutive runs of script overwrite same file
  • Loading branch information
budnik committed Apr 18, 2017
1 parent 644e8e3 commit 7473e9e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions bin/compile
Expand Up @@ -25,8 +25,7 @@ fetch_nginx_tarball() {
mkdir -p $build_dir/bin
$(fetch_nginx_tarball) | tar xzC $build_dir/bin
nginx_version=$($build_dir/bin/nginx-$STACK -V 2>&1 | head -1 | awk '{ print $NF }')
cp -a $bp_dir/scripts/boot $build_dir/bin/boot
cp -a $bp_dir/scripts/config $build_dir/bin/config
cp -a $bp_dir/scripts/{boot,config} -t $build_dir/bin/
echo "-----> Installed ${nginx_version} to /app/bin"

mkdir -p $build_dir/config
Expand Down

0 comments on commit 7473e9e

Please sign in to comment.