git @ Cat's Eye Technologies shelf / e683f72
Create an abspath function which should be relatively okay. Chris Pressey 4 years ago
1 changed file(s) with 16 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
2020 fi
2121 }
2222
23 _shelf_abspath() {
24 CWD=`pwd`
25 path=$1
26 if [ ! -d $path ]; then
27 path=`dirname $path`
28 fi
29 cd "$path"
30 pwd
31 cd "$CWD"
32 }
33
2334 _shelf_ln() {
24 source="$1"
25 CWD=`pwd`
26 source="$CWD/$source"
35 source=`_shelf_abspath "$1"`
2736 dest="$2"
2837 if [ -e "$dest" ]; then
2938 _shelf_verbose $dest already exists
123132 echo "Usage: shelf_unlink {dir}"
124133 return 1
125134 fi
126 CWD=`pwd`
127135 for dir in $*; do
128 dir="$CWD/$dir"
136 dir=`_shelf_abspath "$dir"`
129137 for sub in bin include lib; do
130138 for file in $SHELF_FARMBASE/$sub/*; do
131139 link=`readlink -f "$file"`
140 _shelf_verbose "in $dir found link $link"
132141 case $link in
133142 ${dir}*)
134143 _shelf_show_run rm "$file"
154163 }
155164
156165 shelf_build() {
157 dir="$1"
158166 CWD=`pwd`
159 dir="$CWD/$dir"
160
167
168 dir=`_shelf_abspath "$1"`
161169 cd $dir
162170
163171 # if build command is defined for this, then run it, else