From fd195a95d3c3bceb92b96b702785f47431e80ec8 Mon Sep 17 00:00:00 2001 From: Kenton Murray Date: Sun, 7 Mar 2021 13:18:45 -0500 Subject: [PATCH] Ability to set deployedsha1file instead of hardcoded. Both command line and through config --- git-ftp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/git-ftp b/git-ftp index be42bdfa..cdd56f52 100755 --- a/git-ftp +++ b/git-ftp @@ -199,6 +199,7 @@ OPTIONS --enable-post-errors Fails if post-ftp-push hook raises an error --disable-epsv Tell curl to disable the use of the EPSV command when doing passive FTP transfers. Curl will normally always first attempt to use EPSV before PASV, but with this option, it will not try using EPSV. --auto-init Automatically run init action when running push action + --deployedsha1file The name of the file that keeps the SHA1 hash of the current git commit --version Prints version. -x, --proxy Use the specified proxy. @@ -383,7 +384,12 @@ get_config() { } set_deployed_sha1_file() { - DEPLOYED_SHA1_FILE="$(get_config deployedsha1file "$DEPLOYED_SHA1_FILE")" + DEPLOYED_SHA1_FILE_CONFIG="$(get_config deployedsha1file)" + if [ -z "$DEPLOYED_SHA1_FILE_CONFIG" ]; then + DEPLOYED_SHA1_FILE="$(get_config deployedsha1file "$DEPLOYED_SHA1_FILE")" #If none in config, rerun with harcoded value + else + DEPLOYED_SHA1_FILE=$DEPLOYED_SHA1_FILE_CONFIG + fi } # Simple log func @@ -1810,6 +1816,10 @@ do write_log "Auto init if needed." fi ;; + --deployedsha1file) + DEPLOYED_SHA1_FILE="$2" + shift + ;; -x|--proxy*) case "$#,$1" in *,*=*)