aboutsummaryrefslogtreecommitdiff
path: root/create_links.sh
diff options
context:
space:
mode:
authorAnton Bobov <abobov@gmail.com>2011-10-17 14:10:25 +0600
committerAnton Bobov <abobov@gmail.com>2011-10-17 14:11:22 +0600
commit96e6dd58fa188a710eb8489f67ee45c312b95181 (patch)
tree90379cff11d775dbe391698f6fc8c5eee6d5a342 /create_links.sh
parentb63ddd9406eabce7887ae13057732c9672b3fd75 (diff)
f
Diffstat (limited to 'create_links.sh')
-rwxr-xr-xcreate_links.sh16
1 files changed, 12 insertions, 4 deletions
diff --git a/create_links.sh b/create_links.sh
index 8f27993..6c2ab08 100755
--- a/create_links.sh
+++ b/create_links.sh
@@ -3,8 +3,17 @@
# Based on file from https://github.com/benhoskings/dot-files
set -e
-dir="$(cd "$(dirname "$0")" && pwd)/files"
+dir="$(cd "$(dirname "$0")" && pwd)"
os=$(uname -o)
+ignore="$dir/ignore-$(/bin/hostname)"
+
+filter() {
+ fname="$(basename "$@")"
+ if [[ "$fname" == "." || "$fname" == ".." ]] ; then
+ return 0
+ fi
+ return $(grep -x -F "$fname" "$ignore" >/dev/null 2>&1)
+}
create_windows_link()
{
@@ -28,8 +37,7 @@ create_link()
}
cd &&
-ls --format=single-column --directory "$dir"/.* | while read f ; do
- [ "$f" == "$dir/." ] ||
- [ "$f" == "$dir/.." ] ||
+ls --format=single-column --directory "$dir"/files/.* | while read f ; do
+ filter "$f" ||
create_link "$f" .
done