Skip to content
This repository has been archived by the owner on Aug 4, 2018. It is now read-only.
/ tuck Public archive

πŸ„ symlink farm manager Γ -la-stow

License

Notifications You must be signed in to change notification settings

vdemeester/tuck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ„ tuck Build Status

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