mirror of
https://github.com/SinTan1729/ReVancedBuilder.git
synced 2024-12-26 12:48:36 -06:00
Use timestamp for naming logfiles
This commit is contained in:
parent
a7ac30a676
commit
16c25d7460
1 changed files with 4 additions and 4 deletions
|
@ -3,13 +3,13 @@
|
||||||
# Run only one instance of this script at one time
|
# Run only one instance of this script at one time
|
||||||
[ "${BKLOCKER}" != "running" ] && exec env BKLOCKER="running" flock -en "/tmp/revanced-builder.lock" "$0" "$@" || :
|
[ "${BKLOCKER}" != "running" ] && exec env BKLOCKER="running" flock -en "/tmp/revanced-builder.lock" "$0" "$@" || :
|
||||||
|
|
||||||
# Log everything to a logfile inside logs/
|
|
||||||
log_file="$1/logs/$(date '+%s')"
|
|
||||||
[ -d "$1" ] && mkdir -p "$1/logs" && exec > >(tee "$log_file") 2>&1
|
|
||||||
|
|
||||||
# Get timestamp
|
# Get timestamp
|
||||||
timestamp=$(date '+%s')
|
timestamp=$(date '+%s')
|
||||||
|
|
||||||
|
# Log everything to a logfile inside logs/
|
||||||
|
log_file="$1/logs/$timestamp"
|
||||||
|
[ -d "$1" ] && mkdir -p "$1/logs" && exec > >(tee "$log_file") 2>&1
|
||||||
|
|
||||||
# Set working directory and current directory
|
# Set working directory and current directory
|
||||||
if [ -d "$1" ]; then
|
if [ -d "$1" ]; then
|
||||||
WDIR="$1"
|
WDIR="$1"
|
||||||
|
|
Loading…
Reference in a new issue