repo-cloner/old/dockerbin/run-mirror-update
Václav Valíček b536c883de
move old files to old directory
Signed-off-by: Václav Valíček <valicek1994@gmail.com>
2022-05-04 09:46:41 +02:00

36 lines
570 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
function log(){
local title=${raw:-$name}
[ -z "$title" ] || title=" [$title]"
echo "[$(date +"%X")]$title $@"
}
function die(){
log "$@" 1>&2
exit 1
}
scratch=$(mktemp -d -t tmp.XXXXXXXXXX)
function finish {
rm -rf "$scratch"
}
trap finish EXIT
# necessary checks
pathto=${1:-}
[ -n "$pathto" ] || die "No project specified"
raw=$(basename $pathto | sed 's/^cloner-//g')
# is it enabled?
[ -f "$pathto/.enabled" ] || die "$raw not enabled!"
env BASE=$pathto run-checker | while read line; do log "$line"; done