forked from zone-eu/_template-wp-deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init-symlinks.sh
executable file
·63 lines (42 loc) · 1.56 KB
/
init-symlinks.sh
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
#!/bin/bash
# for debug output, uncomment:
#set -x
#
# Create all required symlinks - forcing overwrite or (plugins, themes, translations) unlinking and re-linking
#
# ensure we start from script directory and remember it
cd "${0%/*}"
dir="$(pwd)"
base="$(basename "$dir")"
# docroot - managed non-wordpress components, force overwrite
cd "$dir/../wordpress"
find ../$base/src/docroot/* -maxdepth 0 -exec ln -sf {} \;
# static files under docroot - managed via FTP
cd "$dir/../wordpress"
find ../static/* -maxdepth 0 -exec ln -s {} \;
# wp-content-uploads - outside deployment, to facilitate safe reinstalls
cd "$dir/../wordpress/wp-content"
ln -s ../../uploads
# wp-content - possibly sunrise.php, force overwrite
cd "$dir/../wordpress/wp-content"
find ../../$base/src/wp-content/* -maxdepth 0 -exec ln -sf {} \;
# plugins
cd "$dir/../wordpress/wp-content/plugins"
find -type l -delete
find ../../../$base/src/plugins/* -maxdepth 0 -exec ln -s {} \;
# themes
cd "$dir/../wordpress/wp-content/themes"
find -type l -delete
find ../../../$base/src/themes/* -maxdepth 0 -exec ln -s {} \;
# mu-plugins
cd "$dir/../wordpress/wp-content/mu-plugins"
find -type l -delete
find ../../../$base/src/mu-plugins/* -maxdepth 0 -exec ln -s {} \;
# translations - plugins
cd "$dir/../wordpress/wp-content/languages/plugins"
find -type l -delete
find ../../../../$base/src/languages/plugins/* -maxdepth 0 -exec ln -s {} \;
# translations - themes
cd "$dir/../wordpress/wp-content/languages/themes"
find -type l -delete
find ../../../../$base/src/languages/themes/* -maxdepth 0 -exec ln -s {} \;