Debian Codegraph @

test/mkrc-simple-output.t

raw
1 $ . "$TESTDIR/helper.sh"
2
3 Making an rc file should move it into dotfiles and create a symlink
4
5 $ touch .example
6
7 $ mkrc -v .example
8 Moving...
9 '*/.example' -> '*/.dotfiles/example' (glob)
10 Linking...
11 '*/.dotfiles/example' -> '*/.example' (glob)
12
13 $ assert_linked "$HOME/.example" "$HOME/.dotfiles/example"
14
15 Making an rc file in a sub-directory should create the directories then
16 create a symlink
17
18 $ mkdir .nested
19 > touch .nested/example
20
21 $ mkrc -v .nested/example
22 Moving...
23 '*/.nested/example' -> '*/.dotfiles/nested/example' (glob)
24 Linking...
25 '*/.dotfiles/nested/example' -> '*/.nested/example' (glob)
26
27 $ assert_linked "$HOME/.nested/example" "$HOME/.dotfiles/nested/example"
28
29 Making an rc file in a deeply nested sub-directory should create all of
30 the required directories then create a symlink
31
32 $ mkdir .nested/deeply
33 > touch .nested/deeply/example
34
35 $ mkrc -v .nested/deeply/example
36 Moving...
37 '*/.nested/deeply/example' -> '*/.dotfiles/nested/deeply/example' (glob)
38 Linking...
39 '*/.dotfiles/nested/deeply/example' -> '*/.nested/deeply/example' (glob)
40
41 $ assert_linked "$HOME/.nested/deeply/example" "$HOME/.dotfiles/nested/deeply/example"
42
43 Making a relative rc file being in a sub-directory should move into dotfiles
44 preserving the full path then symlink
45
46 $ touch .nested/deeply/another_example
47 > cd .nested/deeply
48
49 $ mkrc -v another_example
50 > cd ../..
51 Moving...
52 '*/.nested/deeply/another_example' -> '*/.dotfiles/nested/deeply/another_example' (glob)
53 Linking...
54 '*/.dotfiles/nested/deeply/another_example' -> '*/.nested/deeply/another_example' (glob)
55
56 $ assert_linked "$HOME/.nested/deeply/another_example" "$HOME/.dotfiles/nested/deeply/another_example"
57
58 Making an absolute rc file
59
60 $ touch .an_example
61
62 $ mkrc -v $PWD/.an_example
63 Moving...
64 '*/.an_example' -> '*/.dotfiles/an_example' (glob)
65 Linking...
66 '*/.dotfiles/an_example' -> '*/.an_example' (glob)
67
68 $ assert_linked "$HOME/.an_example" "$HOME/.dotfiles/an_example"