repo-cloner/checker/detector-lib-cfg

30 lines
493 B
Plaintext
Raw Normal View History

2018-02-22 22:09:11 +01:00
#!/bin/bash
# check if varriable is set
[ -n "$CONFIG_DIR" ] || die "ConfigDir is not set - exit!"
function detectorRunCapable(){
if [ -f $CONFIG_DIR/detector.cfg ]
then
return 0
else
return 1
fi
}
function detectorLoadConfig(){
# load config
source $CONFIG_DIR/detector.cfg
# create cache dirs
DET_DIR=$CCLONE_CACHE/detector
DET_TAGS=$DET_DIR/tags
DET_BRANCHES=$DET_DIR/branches
[ -d $DET_TAGS ] || mkdir -p $DET_TAGS
[ -d $DET_BRANCHES ] || mkdir -p $DET_BRANCHES
}