summary refs log tree commit diff
path: root/install.sh
blob: 72214258ec480e0a71f9fab4e969b8dbbf97e2c5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

# Create symlinks in ~ for files in the current directory.

set -e

error() {
  echo "$1"
  exit 1
}

paths=$(find $PWD -type f -not \( -path '*/.git/*' -o -path '*/Library/*' -o -name '.*.sw?' -o -name '.gitignore' -o -name 'README.md' -o -name '*.sh' -o -name '*.plist' \))

for source_path in $paths; do
  rel_path="${source_path#$PWD/}"
  dest_path="$HOME/$rel_path"

  [ -h "$dest_path" ] && continue
  [ -e "$dest_path" ] && error "$dest_path exists"

  mkdir -p "$(dirname $dest_path)"
  ln -s "$source_path" "$dest_path"
  echo "$rel_path"
done
2020-06-07Cast z_stream fields to size_tJune McEnroe 2020-06-07Call static_assert by _Static_assertJune McEnroe 2020-06-07Add OpenBSD to install.shJune McEnroe 2020-06-03Add The Song of AchillesJune McEnroe 2020-06-01Allow redirecting input in everJune McEnroe 2020-05-31Add %c conversion to c scriptJune McEnroe 2020-05-31Add c script to READMEJune McEnroe 2020-05-31Add c scriptJune McEnroe 2020-05-31Update mdoc source URLsJune McEnroe 2020-05-26Remove unfinished PSF fontsJune McEnroe