From 4cb6d87b7da8b852ed8ead5aebde99b1ea6abda7 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Sat, 1 Nov 2014 20:00:48 -0700 Subject: Use symlinks instead of hard links This allows the build dir to be on a different file system than the source dir, and it also enables proper operation of e.g. git checkout/stash. --- scripts/cp_s | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 scripts/cp_s (limited to 'scripts') diff --git a/scripts/cp_s b/scripts/cp_s new file mode 100755 index 0000000..babc5e5 --- /dev/null +++ b/scripts/cp_s @@ -0,0 +1,19 @@ +#!/bin/bash +# This script emulates the cp -s command, which Mac OS doesn't support. + +set -e + +pushd $1 > /dev/null +SRCDIR=`pwd` +DIRS=`find . -type d` +FILES=`find . -type f` +popd > /dev/null + +pushd $2 > /dev/null +for i in $DIRS; do + mkdir -p $i +done +for i in $FILES; do + ln -f -s $SRCDIR/$i $i +done +popd > /dev/null -- cgit v1.1