blob: 6a0f12ebb26ffc27bba95fdd44a077c734e91c65 (
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
#!/bin/bash
post_install() {
create_cache_dirs
echo
echo "Prezto is enabled for all users by default."
echo "To change that, edit /etc/zsh/zshrc file."
echo "Global settings reside in the /etc/zsh/ directory."
echo "To personalize Zsh and Prezto, edit your local ~/.zshrc and ~/.zpreztorc files."
echo "A user can also have a custom, overriding Prezto installation in ~/.zprezto/"
echo "For more information on overrides and local files, see https://github.com/sorin-ionescu/prezto/tree/master/runcoms"
echo
}
post_upgrade() {
create_cache_dirs
}
post_remove() {
remove_cache_dirs
}
cachedir=/var/cache/prezto
moduledir=/usr/lib/prezto/modules
# These modules (as of 20130820) want to have the cache within their own directory
modules_with_cache=(
'node'
'fasd'
'perl'
)
create_cache_dirs() {
# Set up a global cache that's accessible by users.
# A user may be able to override this by loading and configuring/customizing the modules in her own .zshrc
mkdir -p $cachedir
for module in "${modules_with_cache[@]}"
do
if [ ! -f $cachedir/$module/cache.zsh ]; then
mkdir $cachedir/$module
touch $cachedir/$module/cache.zsh
chgrp users $cachedir/$module/cache.zsh
chmod g+w $cachedir/$module/cache.zsh
fi
if [ ! -a $moduledir/$module/cache.zsh ]; then
ln -sf $cachedir/$module/cache.zsh $moduledir/$module/cache.zsh
fi
done
}
remove_cache_dirs() {
# Remove symlinks that point to cache files
for module in "${modules_with_cache[@]}"
do
rm -rf $moduledir/$module/cache.zsh
done
# Remove the global cache
rm -rf $cachedir
}
|