Removed obsolette code
Signed-off-by: Václav Valíček <valicek1994@gmail.com>
This commit is contained in:
parent
9eece76ad9
commit
f78cfb8eee
|
@ -1,42 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
source $(dirname $(realpath $0))/config
|
||||
|
||||
|
||||
function getRepoUniq(){
|
||||
base=$(basename $1 .git)
|
||||
rest=$(dirname $1)
|
||||
# .git (working repo)
|
||||
if [ "$base" == ".git" ]
|
||||
then
|
||||
base=$(basename $rest)
|
||||
rest=$(dirname $rest)
|
||||
fi
|
||||
# extract username - or path
|
||||
namespace=$(basename $rest)
|
||||
# solve ssh domain:namespace/repo.git
|
||||
if [[ "$namespace" == *:* ]]
|
||||
then
|
||||
namespace=$(echo $namespace | cut -d':' -f2)
|
||||
fi
|
||||
csum=$(echo $1 | cksum | cut -d' ' -f1)
|
||||
echo ${namespace}_${base}_${csum}
|
||||
}
|
||||
|
||||
function getRepoPath(){
|
||||
uniq=$(getRepoUniq $1)
|
||||
echo $cfgMirrorPath/$uniq.git
|
||||
}
|
||||
|
||||
function getRepoCache(){
|
||||
uniq=$(getRepoUniq $1)
|
||||
echo $cfgCachePath/$uniq
|
||||
}
|
||||
|
||||
# it the script is not sourced
|
||||
if [[ ! "${BASH_SOURCE[0]}" != "${0}" ]]
|
||||
then
|
||||
getRepoPath $1
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user