summaryrefslogtreecommitdiff
path: root/test/checklinks
blob: 53d36c6ad95d14d3ac436e35fb6140766301f2a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
## vim:ft=zsh

cat > links <<- quux
	foo ignored
	# ignored
	hard foo bar
	soft link file
	soft blub \$quux
quux

alias checklinks='checklinks --parameter quux=flurbl --msglevel 99'

echo barbl > bar
echo flurbl > file
echo morp > flurbl

echo "# checklinks"
checklinks
[[ $(cat foo) == $(cat bar) ]]
[[ $(cat link) == $(cat file) ]]
[[ $(cat blub) == $(cat flurbl) ]]

echo "# checklinks --remove"
checklinks --remove
[[ ! -e foo ]]
[[ -e bar ]]
[[ ! -e link ]]
[[ -e file ]]
[[ ! -e blub ]]
[[ -e flurbl ]]

echo "# checklinks: link source exists already"
echo exists > link
! checklinks
[[ $(cat link) == exists ]]