summaryrefslogtreecommitdiff
path: root/create_fs_view.sh
blob: abeb8817850e0b0cffa6ab6a732e24ce3cc3fdc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
[ -z "$1" ] || [ -z "$2" ] && {
  printf "Usage: create_fs_view.sh <src dir> <trgt dir>\n" ; exit 0
}
[ -d "$1" ] || {
  printf "%s is not a directory\n" "$1" ; exit 1
}
src="$(realpath "$1")"
root="${src%/*}"
pkg="${src##*/}"
trg="$2"
mkdir -p "$trg" 2>/dev/null
#printf "src = %s\n" "$src"
#printf "root = %s\n" "$root"
#printf "pkg = %s\n" "$pkg"
#printf "trg = %s\n" "$trg"
stow -v -t "$trg" -d "$root" --no-folding "$pkg"
find "$trg" -type l -exec detox -v --special '{}' \;