From a111eb7f1a1b5fe6da4dd26c706a9b655e248d6e Mon Sep 17 00:00:00 2001 From: "E. S." Date: Sun, 28 Jul 2024 21:57:29 +0300 Subject: [PATCH] deploy/deploy.sh: more bash/sh fixes --- deploy/deploy.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy/deploy.sh b/deploy/deploy.sh index 611f5d2..2c82dfd 100755 --- a/deploy/deploy.sh +++ b/deploy/deploy.sh @@ -12,13 +12,13 @@ DIR=$(cd "$(dirname "$(readlink -f "$0")")" && pwd) DEV_DIR="$(realpath "$DIR/../")" STAGING_DIR="$HOME/staging" PROD_DIR="$HOME/www" -PHP=/usr/bin/php +PHP="$(which php)" REPO_URI=$(cat "$DEV_DIR/config.yaml" | grep ^git_repo | head -1 | awk '{print $2}') git push origin master [ -d "$STAGING_DIR" ] || mkdir "$STAGING_DIR" -pushd "$STAGING_DIR" +cd "$STAGING_DIR" if [ ! -d .git ]; then git init @@ -42,7 +42,7 @@ cp "$DEV_DIR/config.yaml" . "$DIR"/build_css.sh -i "$DEV_DIR/htdocs/scss" -o "$STAGING_DIR/htdocs/dist-css" || die "build_css failed" $PHP "$DIR"/gen_static_config.php -i "$STAGING_DIR/htdocs" > "$STAGING_DIR/config-static.php" || die "gen_static_config failed" -popd +cd "$DIR" # copy staging to prod rsync -a --delete --delete-excluded --info=progress2 "$STAGING_DIR/" "$PROD_DIR/" \