chore: import.sh: read config from env
This commit is contained in:
parent
99d8bd6b80
commit
2fe58482db
@ -3,23 +3,38 @@
|
||||
WORKSPACE=$(cd "$(dirname "$0")"/.. && pwd)
|
||||
. "$WORKSPACE"/scripts/common.sh
|
||||
|
||||
if [ -z "$WOJ_ENDPOINT" ]; then
|
||||
read -p "Enter HTTP API Endpoint: " -r endpoint
|
||||
if [ -z "$endpoint" ]; then
|
||||
log_error "[-] HTTP API Endpoint cannot be empty"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
endpoint="$WOJ_ENDPOINT"
|
||||
log_info "[*] Using HTTP API Endpoint: $endpoint"
|
||||
fi
|
||||
|
||||
if [ -z "$WOJ_TOKEN" ]; then
|
||||
read -p "Enter Token: " -r token
|
||||
if [ -z "$token" ]; then
|
||||
log_error "[-] Token cannot be empty"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
token="$WOJ_TOKEN"
|
||||
log_info "[*] Using Token: $token"
|
||||
fi
|
||||
|
||||
if [ -z "$WOJ_DIR" ]; then
|
||||
read -p "Enter Directory: " -r directory
|
||||
if [ ! -d "$directory" ]; then
|
||||
log_error "[-] Not a Directory"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
directory="$WOJ_DIR"
|
||||
log_info "[*] Using Directory: $directory"
|
||||
fi
|
||||
|
||||
for problem in "$directory/"*; do
|
||||
if [ -d "$problem" ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user