Skip to content

Commit

Permalink
Merge pull request timanovsky#10 from edmorley/dont-delete-build-dir
Browse files Browse the repository at this point in the history
Don't delete the build directory root
  • Loading branch information
timanovsky authored Apr 1, 2021
2 parents 5485d38 + f531487 commit 6d1c902
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bin/compile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env bash
# bin/compile <build-dir> <cache-dir> <env-dir>

# Ensure wildcards in globs match dotfiles too.
shopt -s dotglob

BUILD_DIR=${1:-}
CACHE_DIR=${2:-}
ENV_DIR=${3:-}
Expand All @@ -16,9 +19,7 @@ if [ -f $ENV_DIR/PROJECT_PATH ]; then
echo " moving working dir: $PROJECT_PATH to $TMP_DIR"
cp -R $BUILD_DIR/$PROJECT_PATH/. $TMP_DIR/
echo " cleaning build dir $BUILD_DIR"
rm -rf $BUILD_DIR
echo " recreating $BUILD_DIR"
mkdir -p $BUILD_DIR
rm -rf $BUILD_DIR/*
echo " copying preserved work dir from cache $TMP_DIR to build dir $BUILD_DIR"
cp -R $TMP_DIR/. $BUILD_DIR/
echo " cleaning tmp dir $TMP_DIR"
Expand Down

0 comments on commit 6d1c902

Please sign in to comment.