git @ Cat's Eye Technologies shelf / c678421
abspath was not okay enough, so split into two, which might be okay. Chris Pressey 4 years ago
1 changed file(s) with 13 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
2020 fi
2121 }
2222
23 _shelf_abspath() {
23 _shelf_abspath_dir() {
2424 CWD=`pwd`
25 path=$1
26 if [ ! -d $path ]; then
27 path=`dirname $path`
28 fi
29 cd "$path"
25 cd "$1"
3026 pwd
3127 cd "$CWD"
3228 }
3329
30 _shelf_abspath_file() {
31 dir=`dirname $1`
32 dir=`_shelf_abspath_dir "$dir"`
33 base=`basename $1`
34 echo "$dir/$base"
35 }
36
3437 _shelf_ln() {
35 source=`_shelf_abspath "$1"`
38 source=`_shelf_abspath_file "$1"`
39 _shelf_verbose "linking to $1 which absolutized as $source"
3640 dest="$2"
3741 if [ -e "$dest" ]; then
3842 _shelf_verbose $dest already exists
133137 return 1
134138 fi
135139 for dir in $*; do
136 dir=`_shelf_abspath "$dir"`
140 dir=`_shelf_abspath_dir "$dir"`
137141 for sub in bin include lib; do
138142 for file in $SHELF_FARMBASE/$sub/*; do
139143 link=`readlink -f "$file"`
165169 shelf_build() {
166170 CWD=`pwd`
167171
168 dir=`_shelf_abspath "$1"`
172 dir=`_shelf_abspath_dir "$1"`
169173 cd $dir
170174
171175 # if build command is defined for this, then run it, else