1
0
Fork 0
mirror of https://github.com/overleaf/toolkit.git synced 2025-04-19 23:38:06 +02:00

Add help to bin/init

This commit is contained in:
Shane Kilkelly 2020-06-17 10:19:38 +01:00
parent 281f3fa480
commit 0dddba0701

View file

@ -2,6 +2,13 @@
set -euo pipefail
function usage() {
echo "Usage: bin/init"
echo ""
echo "Initialises local configuration files in the 'config/' directory"
echo ""
}
function check_existing_config() {
if [[ -f ./config/overleaf.rc ]] || [[ -f ./config/variables.env ]]; then
echo "ERROR: Config files already exist, exiting "
@ -17,6 +24,10 @@ function set_up_config_files() {
}
function __main__() {
if [[ "${1:-null}" == "help" ]] || [[ "${1:-null}" == "--help" ]]; then
usage
exit
fi
check_existing_config
set_up_config_files
}