]> jfr.im git - irc/evilnet/x3.git/blob - install-r.sh
Fixed typo in X3 help durations
[irc/evilnet/x3.git] / install-r.sh
1 #! /bin/sh
2
3 # This is a hacky solution to the problem of INSTALL not knowing how to recursively copy files
4 # and our need to recursively copy with exceptions the plugin tree. It works on linux,
5 # but needs serious work to be more portable. Please Help. -Rubin
6 SRC=$1
7 DST=$2
8
9 # TODO: find banaries like 'find' and 'cp' in common locations and/or path, and
10 # use them there instead of assuming they are in path.
11
12 if [ "_$DST" = _ ]; then
13 exit
14 fi
15
16 cd `dirname "$SRC"`
17 SRCDIR=`basename "$SRC"`
18 find "$SRCDIR" \! -path '*/.*' | \
19 while read f; do \
20 d="$DST/${f#foo/}"; \
21 mkdir -p "$(dirname "$d")"; \
22 if [ -f $f ]; then cp -v $f $d; fi; \
23 done
24 # this will break if SRCDIR has hidden directories in it :/
25 #find "$SRCDIR" \! -path '*/.*'
26