73 lines
2.5 KiB
Bash
Executable File
73 lines
2.5 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# This script is designed to be called from the top level directory of your project and must be placed in the $PROJECT_HOME/scripts/ folder
|
|
|
|
echo "Creating new config file..."
|
|
|
|
echo -n "Please enter the file name of your config file: "
|
|
read conf_file
|
|
if [ -z "${conf_file}" ]; then
|
|
echo "Please input a value for your config file name before pressing enter"; exit 1
|
|
fi
|
|
|
|
if [ -e ./config/"${conf_file}" ]; then
|
|
echo "Sorry, the file ./scripts/${conf_file} already exists. Either delete the existing file or choose a different name and try again."; exit 1
|
|
fi
|
|
|
|
echo -n "Please enter the apexappid you would like to use. This should be chosen very carefully to avoid conflicts with other developers' app ids: "
|
|
read apexappid
|
|
|
|
echo -n "Please enter the name of your workspace: "
|
|
read workspace_name
|
|
|
|
echo -n "Please enter the parsing schema for the app you are using. Note that parsing schema should be all caps: "
|
|
read parsing_schema
|
|
|
|
echo "NOTE: The app_alias variable should only be set for well known versions of the app (i.e. production or some dev versions) in order to avoid potentially damaging conflicts. Press [ENTER] to leave the variable unset"
|
|
echo -n "Please enter the app_alias for your app: "
|
|
read app_alias
|
|
|
|
echo -n "Please enter your Apex database connection in the following format [Hostname:port/SID]: "
|
|
read database_connection
|
|
|
|
echo -n "Please enter your username for the given database: "
|
|
read username
|
|
|
|
echo -n "Please enter your password: "
|
|
read password
|
|
|
|
if [ ! -d ./config/ ]; then
|
|
mkdir config
|
|
fi
|
|
|
|
echo "apexappid=${apexappid}" > ./config/"${conf_file}"
|
|
echo "workspace_name=${workspace_name}" >> ./config/"${conf_file}"
|
|
echo "parsing_schema=${parsing_schema}" >> ./config/"${conf_file}"
|
|
echo "app_alias=${app_alias}" >> ./config/"${conf_file}"
|
|
echo "database_connection=${database_connection}" >> ./config/"${conf_file}"
|
|
echo "username=${username}" >> ./config/"${conf_file}"
|
|
echo "password=${password}" >> ./config/"${conf_file}"
|
|
|
|
echo "Config file successfully generated! It looks like this:"
|
|
|
|
cat ./config/"${conf_file}"
|
|
|
|
echo "If anything looks wrong you can simply edit the file yourself at ./config/${conf_file}"
|
|
|
|
echo
|
|
|
|
echo -n "Would you like to switch to the new config file now [y/n]: "
|
|
read switch_bool
|
|
|
|
if [ "${switch_bool}" == "y" ]; then
|
|
cd config
|
|
if [ -h asc.conf ]; then
|
|
rm asc.conf
|
|
fi
|
|
ln -s "${conf_file}" asc.conf
|
|
cd ..
|
|
echo "./config/asc.conf now points to ./config/$( readlink ./config/asc.conf )"
|
|
else
|
|
echo "Config file was not switched. Run 'npm run switch-conf-file' if you would like to change this."
|
|
fi
|