summaryrefslogtreecommitdiffstats
path: root/gen_links.sh.inc
diff options
context:
space:
mode:
Diffstat (limited to 'gen_links.sh.inc')
-rw-r--r--gen_links.sh.inc13
1 files changed, 11 insertions, 2 deletions
diff --git a/gen_links.sh.inc b/gen_links.sh.inc
index 2fcb9d1c..aba8ca16 100644
--- a/gen_links.sh.inc
+++ b/gen_links.sh.inc
@@ -1,12 +1,21 @@
#!dont_run_this
# This file is sourced by */gen_links.sh
+rm -f .gitignore
+
+gen_link() {
+ src="$1"
+ f="$2"
+ echo "Linking $f"
+ ln -sf "$src" "$f"
+ echo "$f" >> .gitignore
+}
+
gen_links() {
DIR=$1
shift
FILES=$*
for f in $FILES; do
- echo "Linking $f"
- ln -sf $DIR/$f $f
+ gen_link "$DIR/$f" "$f"
done
}