apex-source-control/scripts/generate-app-id
2016-06-06 15:48:08 -04:00

24 lines
915 B
Plaintext
Executable File

# designed to be called from top level project dir
script_folder=$(dirname $0)
source config/asc.conf || exit 1
sqlplus ${username}/${password}@${database_connection} @${script_folder}/generate_new_app_id.sql || exit 1
app_id=$(head -c -1 new_app_id.txt | sed -e 's/[[:space:]]*$//')
if [ -h config/asc.conf ]; then
conf_file=$(readlink ./config/asc.conf)
echo "The id '${app_id}' will be written to '${conf_file}'. Is this alright? [y/N]: "
read can_write
if [ "${can_write}" == "y" ]; then
sed -i 's/^apexappid=.*/apexappid=${app_id}/' config/${conf_file}
echo "apexappid in '${conf_file}' has been replaced with '${app_id}'. The new config file looks like this: "
cat config/${conf_file}
else
echo -n "The generated app id was not written to file. "
echo "You can change this manually by changing the apexappid of your config to '${app_id}'"
fi
fi
rm -f config/new_app_id.txt