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:
parent
281f3fa480
commit
0dddba0701
1 changed files with 11 additions and 0 deletions
11
bin/init
11
bin/init
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue