tuck
is symlink farm manager Γ -la-stow written in Go. In a
nutshell, it's a tools that create symlink in a target based on a
source folder and modules.
$ tree testdata
testdata
βββ a
βΒ Β βββ b
βΒ Β βββ 1
βββ b
βΒ Β βββ 2
βββ c
βΒ Β βββ 5
βΒ Β βββ d
βΒ Β βββ 3
βββ d
βββ 6
βββ e
βΒ Β βββ 7
βΒ Β βββ f
βΒ Β βββ 4
βββ f
βββ 9
βββ g
βββ 8
10 directories, 9 files
$ tree target
target
0 directories, 0 files
# the following copies the content of the folder a from testdata to target
$ tuck -s testdata -t target a
tuck module: testdata/a into target
$ tree target
target
βββ b
βββ 1 -> /home/vincent/go/src/github.com/vdemeester/tuck/testdata/a/b/1
1 directory, 1 file
# it supports globing
$ tuck -s testdata -t target '*'
tuck module: testdata/a into target
tuck module: testdata/b into target
tuck module: testdata/c into target
tuck module: testdata/d into target
$ tree target
target
βββ 2 -> /home/vincent/go/src/github.com/vdemeester/tuck/testdata/b/2
βββ 5 -> /home/vincent/go/src/github.com/vdemeester/tuck/testdata/c/5
βββ 6 -> /home/vincent/go/src/github.com/vdemeester/tuck/testdata/d/6
βββ b
βΒ Β βββ 1 -> /home/vincent/go/src/github.com/vdemeester/tuck/testdata/a/b/1
βββ d
βΒ Β βββ 3 -> /home/vincent/go/src/github.com/vdemeester/tuck/testdata/c/d/3
βββ e
βΒ Β βββ 7 -> /home/vincent/go/src/github.com/vdemeester/tuck/testdata/d/e/7
βΒ Β βββ f
βΒ Β βββ 4 -> /home/vincent/go/src/github.com/vdemeester/tuck/testdata/d/e/f/4
βββ f
βββ 9 -> /home/vincent/go/src/github.com/vdemeester/tuck/testdata/d/f/9
βββ g
βββ 8 -> /home/vincent/go/src/github.com/vdemeester/tuck/testdata/d/f/g/8
6 directories, 9 files
It's also possible to remove the symlink the same way, just use -D
or --delete
flag. There is still a TODO
on cleaning empty folders
afterwards though.
$ tuck -d testdata -t target -D '*' ~/go/src/github.com/vdemeester/tuck
tuck module: testdata/a into target
(FIXME: should clean after) skipping /home/vincent/go/src/github.com/vdemeester/tuck/target
(FIXME: should clean after) skipping /home/vincent/go/src/github.com/vdemeester/tuck/target/b
tuck module: testdata/b into target
(FIXME: should clean after) skipping /home/vincent/go/src/github.com/vdemeester/tuck/target
tuck module: testdata/c into target
(FIXME: should clean after) skipping /home/vincent/go/src/github.com/vdemeester/tuck/target
(FIXME: should clean after) skipping /home/vincent/go/src/github.com/vdemeester/tuck/target/d
tuck module: testdata/d into target
(FIXME: should clean after) skipping /home/vincent/go/src/github.com/vdemeester/tuck/target
(FIXME: should clean after) skipping /home/vincent/go/src/github.com/vdemeester/tuck/target/e
(FIXME: should clean after) skipping /home/vincent/go/src/github.com/vdemeester/tuck/target/e/f
(FIXME: should clean after) skipping /home/vincent/go/src/github.com/vdemeester/tuck/target/f
(FIXME: should clean after) skipping /home/vincent/go/src/github.com/vdemeester/tuck/target/f/g
$ tree target
target
βββ b
βββ d
βββ e
βΒ Β βββ f
βββ f
βββ g
6 directories, 0 files