Skip to content

Commit

Permalink
Don't delete the build directory root (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
edmorley authored Apr 1, 2021
1 parent 5485d38 commit b11a858
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 b11a858

Please sign in to comment.