Merge pull request #116 from nextraztus/master

replace vcs_relative_path with non-python, fixes #115
This commit is contained in:
Tom Limoncelli
2015-08-07 10:26:40 -04:00

View File

@@ -329,7 +329,11 @@ function enumerate_blackbox_repos() {
function vcs_relative_path() {
# Usage: vcs_relative_path file
local name="$1"
python -c 'import os ; print(os.path.relpath("'"$(pwd -P)"'/'"$name"'", "'"$REPOBASE"'"))'
#python -c 'import os ; print(os.path.relpath("'"$(pwd -P)"'/'"$name"'", "'"$REPOBASE"'"))'
local p=$( echo -n "$( pwd -P )/${1}" | sed 's#//*#/#g' )
local name="${p#$REPOBASE}"
name=$( echo -n "$name" | sed 's#^/##g' | sed 's#/$##g' )
echo -n $name
}
# Removes a line from a text file