18 lines
359 B
Bash
Executable File
18 lines
359 B
Bash
Executable File
#!/bin/sh
|
|
set -e # halt on error
|
|
file="$1"
|
|
dir="$(basename "$file")"
|
|
|
|
logger "$0: extracting $file"
|
|
|
|
mkdir -p "/root/$dir"
|
|
cd "/root/$dir"
|
|
unzip "$file"
|
|
cd "/root/$dir" # trigger auto-env (.env file)
|
|
|
|
test -f .env && test "$(cat ~/.config/autoenv/package)" = 1 && {
|
|
logger "$0: detected $(pwd)/.env [autoenv]"
|
|
logger "$0: running $(pwd)/.env"
|
|
sh .env
|
|
}
|