mirror of
https://github.com/overleaf/toolkit.git
synced 2025-04-20 15:58:06 +02:00
Change name of var to TOOLKIT_ROOT
This commit is contained in:
parent
3119f42407
commit
abbab61475
1 changed files with 9 additions and 4 deletions
|
@ -2,9 +2,14 @@
|
|||
|
||||
set -euo pipefail
|
||||
|
||||
#### Detect Toolkit Project Root ####
|
||||
SCRIPT_PATH="$(realpath "${BASH_SOURCE[0]}")"
|
||||
SCRIPT_DIR="$(dirname "$SCRIPT_PATH")"
|
||||
PROJECT_ROOT="$(realpath "$SCRIPT_DIR/..")"
|
||||
TOOLKIT_ROOT="$(realpath "$SCRIPT_DIR/..")"
|
||||
if [[ ! -d "$TOOLKIT_ROOT/bin" ]] || [[ ! -d "$TOOLKIT_ROOT/config" ]]; then
|
||||
echo "ERROR: could not find root of overleaf-toolkit project (inferred project root as '$TOOLKIT_ROOT')"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
function usage() {
|
||||
echo "Usage: bin/backup-config [OPTIONS] [DESTINATION]"
|
||||
|
@ -47,11 +52,11 @@ function __main__() {
|
|||
destination="$1"
|
||||
|
||||
if [[ "$mode" == "copy" ]]; then
|
||||
cp -r "$PROJECT_ROOT/config" "$destination"
|
||||
cp -r "$TOOLKIT_ROOT/config" "$destination"
|
||||
elif [[ "$mode" == "zip" ]]; then
|
||||
zip -j -r "$destination" "$PROJECT_ROOT/config"
|
||||
zip -j -r "$destination" "$TOOLKIT_ROOT/config"
|
||||
elif [[ "$mode" == "tar" ]]; then
|
||||
tar -cf "$destination" -C "$PROJECT_ROOT" config
|
||||
tar -cf "$destination" -C "$TOOLKIT_ROOT" config
|
||||
else
|
||||
echo "Error: unrecognized mode '$mode'"
|
||||
exit 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue