Skip to content

Commit e8e2e5e

Browse files
committed
Fix incorrect documentation in deploy.sh
1 parent 3351506 commit e8e2e5e

File tree

1 file changed

+8
-27
lines changed

1 file changed

+8
-27
lines changed

deploy.sh

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,7 @@ Options:
1515
deploy branch.
1616
-n, --no-hash Don't append the source commit's hash to the deploy
1717
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+
"
3219

3320
bundle exec middleman build --clean
3421

@@ -38,12 +25,6 @@ parse_args() {
3825
source .env
3926
fi
4027

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-
4728
# Parse arg flags
4829
# If something is exposed as an environment variable, set/overwrite it
4930
# here. Otherwise, set/overwrite the internal variable instead.
@@ -98,24 +79,24 @@ main() {
9879

9980
commit_title=`git log -n 1 --format="%s" HEAD`
10081
commit_hash=` git log -n 1 --format="%H" HEAD`
101-
82+
10283
#default commit message uses last title if a custom one is not supplied
10384
if [[ -z $commit_message ]]; then
10485
commit_message="publish: $commit_title"
10586
fi
106-
87+
10788
#append hash to commit message unless no hash flag was found
10889
if [ $append_hash = true ]; then
10990
commit_message="$commit_message"$'\n\n'"generated from commit $commit_hash"
11091
fi
111-
92+
11293
previous_branch=`git rev-parse --abbrev-ref HEAD`
11394

11495
if [ ! -d "$deploy_directory" ]; then
11596
echo "Deploy directory '$deploy_directory' does not exist. Aborting." >&2
11697
return 1
11798
fi
118-
99+
119100
# must use short form of flag in ls for compatibility with OS X and BSD
120101
if [[ -z `ls -A "$deploy_directory" 2> /dev/null` && -z $allow_empty ]]; then
121102
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() {
124105

125106
if git ls-remote --exit-code $repo "refs/heads/$deploy_branch" ; then
126107
# deploy_branch exists in $repo; make sure we have the latest version
127-
108+
128109
disable_expanded_output
129110
git fetch --force $repo $deploy_branch:$deploy_branch
130111
enable_expanded_output
@@ -207,7 +188,7 @@ restore_head() {
207188
else
208189
git symbolic-ref HEAD refs/heads/$previous_branch
209190
fi
210-
191+
211192
git reset --mixed
212193
}
213194

@@ -219,4 +200,4 @@ sanitize() {
219200
"$@" 2> >(filter 1>&2) | filter
220201
}
221202

222-
[[ $1 = --source-only ]] || main "$@"
203+
[[ $1 = --source-only ]] || main "$@"

0 commit comments

Comments
 (0)