@@ -3,16 +3,22 @@ set -o errtrace
3
3
set -o nounset
4
4
5
5
6
- # SCRIPT DISABLED
7
- echo ' ERROR: script disabled' 1>&2
8
- exit 1
9
-
10
-
11
6
function _change_to_repo_dir {
12
7
cd " ${0%/* } /.." > /dev/null
13
8
}
14
9
15
10
11
+ function _prep {
12
+ printf " \e[1m\e[7m %-80s\e[0m\n" ' Preparing to State of the Commons'
13
+ if [[ -d temp_download ]]
14
+ then
15
+ # Remove modified HTML files to prevent issues with --continue
16
+ find temp_download -name ' *.html' -delete
17
+ mv temp_download stateof.creativecommons.org
18
+ fi
19
+ }
20
+
21
+
16
22
function _mirror {
17
23
# Note: the --mirror option is equivalent to:
18
24
# --recursive
@@ -21,6 +27,7 @@ function _mirror {
21
27
# --no-remove-listing
22
28
wget \
23
29
--adjust-extension \
30
+ --backup-converted \
24
31
--continue \
25
32
--convert-links \
26
33
--exclude-directories=${1} comments,${1} feed,${1} wp-json \
@@ -34,17 +41,6 @@ function _mirror {
34
41
}
35
42
36
43
37
- prep () {
38
- printf " \e[1m\e[7m %-80s\e[0m\n" ' Preparing to State of the Commons'
39
- if [[ -d temp_download ]]
40
- then
41
- # Remove modified HTML files to prevent issues with --continue
42
- find temp_download -name ' *.html' -delete
43
- mv temp_download stateof.creativecommons.org
44
- fi
45
- }
46
-
47
-
48
44
function _2017_root {
49
45
printf " \e[1m\e[7m %-80s\e[0m\n" ' Mirroring 2017 State of the Commons'
50
46
# Mirror
@@ -69,6 +65,40 @@ function _2015_subdir {
69
65
}
70
66
71
67
68
+ function _fetch_missing_files {
69
+ printf " \e[1m\e[7m %-80s\e[0m\n" ' Fetching missing files'
70
+ local _dom=' stateof.creativecommons.org'
71
+
72
+ local _dir=' /wp-content/uploads/2018/04/'
73
+ local _file=' arrow_down_blk.svg'
74
+ mkdir -p " ${_dom} /${_dir} "
75
+ wget --continue -O ${_dom}${_dir}${_file} " https://${_dom}${_dir}${_file} "
76
+
77
+ local _dir=' /wp-includes/js/'
78
+ local _file=' wp-emoji-release.min.js'
79
+ mkdir -p " ${_dom} /${_dir} "
80
+ wget --continue -O ${_dom}${_dir}${_file} " https://${_dom}${_dir}${_file} "
81
+
82
+ local _dir=' /2016/wp-includes/js/'
83
+ local _file=' wp-emoji-release.min.js'
84
+ mkdir -p " ${_dom} /${_dir} "
85
+ wget --continue -O ${_dom}${_dir}${_file} " https://${_dom}${_dir}${_file} "
86
+
87
+ local _d=' /2016/wp-content/plugins/revslider/public/assets/js/extensions/'
88
+ local _dir=" ${_d} "
89
+ mkdir -p " ${_dom} /${_dir} "
90
+ for _file in \
91
+ ' revolution.extension.slideanims.min.js' \
92
+ ' revolution.extension.actions.min.js' \
93
+ ' revolution.extension.layeranimation.min.js' \
94
+ ' revolution.extension.parallax.min.js'
95
+ do
96
+ wget --continue -O ${_dom}${_dir}${_file} \
97
+ " https://${_dom}${_dir}${_file} "
98
+ done
99
+ }
100
+
101
+
72
102
function _cleanup {
73
103
printf " \e[1m\e[7m %-80s\e[0m\n" ' Performing clean-up on mirror'
74
104
if [[ -d stateof.creativecommons.org ]]
90
120
_2017_root
91
121
_2016_subdir
92
122
_2015_subdir
123
+ _fetch_missing_files
93
124
_cleanup
0 commit comments