@@ -15,20 +15,7 @@ Options:
15
15
deploy branch.
16
16
-n, --no-hash Don't append the source commit's hash to the deploy
17
17
commit's message.
18
- -c, --config-file PATH Override default & environment variables' values
19
- with those in set in the file at 'PATH'. Must be the
20
- first option specified.
21
-
22
- Variables:
23
-
24
- GIT_DEPLOY_DIR Folder path containing the files to deploy.
25
- GIT_DEPLOY_BRANCH Commit deployable files to this branch.
26
- GIT_DEPLOY_REPO Push the deploy branch to this repository.
27
-
28
- These variables have default values defined in the script. The defaults can be
29
- overridden by environment variables. Any environment variables are overridden
30
- by values set in a '.env' file (if it exists), and in turn by those set in a
31
- file specified by the '--config-file' option."
18
+ "
32
19
33
20
bundle exec middleman build --clean
34
21
@@ -38,12 +25,6 @@ parse_args() {
38
25
source .env
39
26
fi
40
27
41
- # Set args from file specified on the command-line.
42
- if [[ $1 = " -c" || $1 = " --config-file" ]]; then
43
- source " $2 "
44
- shift 2
45
- fi
46
-
47
28
# Parse arg flags
48
29
# If something is exposed as an environment variable, set/overwrite it
49
30
# here. Otherwise, set/overwrite the internal variable instead.
@@ -98,24 +79,24 @@ main() {
98
79
99
80
commit_title=` git log -n 1 --format=" %s" HEAD`
100
81
commit_hash=` git log -n 1 --format=" %H" HEAD`
101
-
82
+
102
83
# default commit message uses last title if a custom one is not supplied
103
84
if [[ -z $commit_message ]]; then
104
85
commit_message=" publish: $commit_title "
105
86
fi
106
-
87
+
107
88
# append hash to commit message unless no hash flag was found
108
89
if [ $append_hash = true ]; then
109
90
commit_message=" $commit_message " $' \n\n ' " generated from commit $commit_hash "
110
91
fi
111
-
92
+
112
93
previous_branch=` git rev-parse --abbrev-ref HEAD`
113
94
114
95
if [ ! -d " $deploy_directory " ]; then
115
96
echo " Deploy directory '$deploy_directory ' does not exist. Aborting." >&2
116
97
return 1
117
98
fi
118
-
99
+
119
100
# must use short form of flag in ls for compatibility with OS X and BSD
120
101
if [[ -z ` ls -A " $deploy_directory " 2> /dev/null` && -z $allow_empty ]]; then
121
102
echo " Deploy directory '$deploy_directory ' is empty. Aborting. If you're sure you want to deploy an empty tree, use the --allow-empty / -e flag." >&2
@@ -124,7 +105,7 @@ main() {
124
105
125
106
if git ls-remote --exit-code $repo " refs/heads/$deploy_branch " ; then
126
107
# deploy_branch exists in $repo; make sure we have the latest version
127
-
108
+
128
109
disable_expanded_output
129
110
git fetch --force $repo $deploy_branch :$deploy_branch
130
111
enable_expanded_output
@@ -207,7 +188,7 @@ restore_head() {
207
188
else
208
189
git symbolic-ref HEAD refs/heads/$previous_branch
209
190
fi
210
-
191
+
211
192
git reset --mixed
212
193
}
213
194
@@ -219,4 +200,4 @@ sanitize() {
219
200
" $@ " 2> >( filter 1>&2 ) | filter
220
201
}
221
202
222
- [[ $1 = --source-only ]] || main " $@ "
203
+ [[ $1 = --source-only ]] || main " $@ "
0 commit comments