Skip to content

Instantly share code, notes, and snippets.

@ushkinaz
Last active October 6, 2015 19:08
Show Gist options
  • Save ushkinaz/3039914 to your computer and use it in GitHub Desktop.
Save ushkinaz/3039914 to your computer and use it in GitHub Desktop.
Copying config files after checkout
#!/bin/bash
# Config
# ------
# hooks.configenv
ROOT_PATH="$(pwd)"
prev_sha=$1
curr_sha=$2
branch_checkout=$3
# --- Config
config_env=$(git config hooks.configenv)
if [ "$config_env" = "" ]; then
config_env="stb"
fi
declare -a apps=("abra" "drifloon" "gamayun" "krabby" "kadabra" "psyduck" "simurgh" "swinub" "watchdog" "zubat");
echo "Copying config files from $config_env"
for app in ${apps[@]}; do
rm -rf $ROOT_PATH/$app/src/main/config/local/*
mkdir -p $ROOT_PATH/$app/src/main/config/local
cp -f $ROOT_PATH/$app/src/main/config/$config_env/* $ROOT_PATH/$app/src/main/config/local/
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment