blob: 69dcb2bae22e95455401deceb6ba9c1a28a13157 (
plain) (
blame)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
#!/usr/bin/env bash
locked_init() {
pushd ~/ > /dev/null
mkdir -p ~/.emacs.d/.cache/
mkdir -p ~/.local/share/autojump/
touch ~/.local/share/autojump/autojump.txt
# clone all missing repos
mr checkout > /dev/null
printf "" > /tmp/mr-repos
mr inject > /dev/null
printf "(\n" > /tmp/mr-projectile
sed -E 's/\/home\/andreh/~/' /tmp/mr-repos | awk '{print "\""$1"\""}' >> /tmp/mr-projectile
printf ")" >> /tmp/mr-projectile
cp /tmp/mr-projectile ~/.emacs.d/.cache/projectile-bookmarks.eld
popd > /dev/null
}
touch /tmp/mr-lock
exec 221>/tmp/mr-lock
echo before
flock -n -e 221 && {
echo doing
locked_init
} || {
printf "" # noop: couldn't acquire lock
echo "cant acquire lock"
}
echo after
export -f locked_init
# Tests
pushd $DOTFILES > /dev/null
sizes=$(git diff-files --ignore-submodules | awk '{print $6}' | xargs du | awk '{print $1}')
for size in $sizes; do
if [[ $size = 1 ]]; then
# https://github.com/AGWA/git-crypt/issues/53
echo "dotfiles contains encrypted file with 0 bytes"
fi
done
popd > /dev/null
|