Skip to content

Commit eaad542

Browse files
authored
Upgrade wrapper from released tag (#32)
1 parent 3818b19 commit eaad542

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ In order to use the `hugow` binary, you only need to download it and place it in
2020
of your Hugo project.
2121

2222
```bash
23-
curl -o hugow https://raw.githubusercontent.com/khos2ow/hugo-wrapper/master/hugow && chmod +x hugow
23+
curl -o hugow https://github.com/khos2ow/hugo-wrapper/releases/download/v1.0.2/hugow && chmod +x hugow
2424
```
2525

2626
or
2727

2828
```bash
29-
wget -O hugow https://raw.githubusercontent.com/khos2ow/hugo-wrapper/master/hugow && chmod +x hugow
29+
wget -O hugow https://github.com/khos2ow/hugo-wrapper/releases/download/v1.0.2/hugow && chmod +x hugow
3030
```
3131

3232
## Upgrade Hugo Wrapper

example/hugow

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# ------------------------------------------------------------------------------
2020

2121
# ------------------------------------------------------------------------------
22-
# Hugo Wrapper (v1.0.1)
22+
# Hugo Wrapper (v1.0.2)
2323
#
2424
# Hugo Wrapper is a POSIX-style shell script which acts as a wrapper to download
2525
# and execute Hugo binary for your platform. It can be executed in variety of
@@ -35,7 +35,7 @@
3535

3636
set -e
3737

38-
VERSION_NUMBER="v1.0.1"
38+
VERSION_NUMBER="v1.0.2"
3939

4040
# hugo-wrapper command available flags
4141
get_version=""
@@ -281,7 +281,11 @@ fi
281281
# ------------------------------------------------------------------------------
282282
if [ "$upgrade" = true ]; then
283283
printf "downloading hugow binary ... "
284-
$DOWNLOAD_COMMAND $DOWNLOAD_SILENT $DOWNLOAD_REDIRECT $DOWNLOAD_OUTPUT "hugow" "https://raw.githubusercontent.com/khos2ow/hugo-wrapper/master/hugow" &
284+
285+
latest_release=`$DOWNLOAD_COMMAND $DOWNLOAD_SILENT $DOWNLOAD_REDIRECT ${DOWNLOAD_OUTPUT}- https://api.github.com/repos/khos2ow/hugo-wrapper/releases/latest`
286+
versionToDownload=`parse_json "$latest_release" "tag_name"`
287+
288+
$DOWNLOAD_COMMAND $DOWNLOAD_SILENT $DOWNLOAD_REDIRECT $DOWNLOAD_OUTPUT "hugow" "https://github.com/khos2ow/hugo-wrapper/releases/download/${versionToDownload}/hugow" &
285289
wait
286290
printf "[done]\n"
287291
chmod +x hugow

hugow

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# ------------------------------------------------------------------------------
2020

2121
# ------------------------------------------------------------------------------
22-
# Hugo Wrapper (v1.0.1)
22+
# Hugo Wrapper (v1.0.2)
2323
#
2424
# Hugo Wrapper is a POSIX-style shell script which acts as a wrapper to download
2525
# and execute Hugo binary for your platform. It can be executed in variety of
@@ -35,7 +35,7 @@
3535

3636
set -e
3737

38-
VERSION_NUMBER="v1.0.1"
38+
VERSION_NUMBER="v1.0.2"
3939

4040
# hugo-wrapper command available flags
4141
get_version=""
@@ -281,7 +281,11 @@ fi
281281
# ------------------------------------------------------------------------------
282282
if [ "$upgrade" = true ]; then
283283
printf "downloading hugow binary ... "
284-
$DOWNLOAD_COMMAND $DOWNLOAD_SILENT $DOWNLOAD_REDIRECT $DOWNLOAD_OUTPUT "hugow" "https://raw.githubusercontent.com/khos2ow/hugo-wrapper/master/hugow" &
284+
285+
latest_release=`$DOWNLOAD_COMMAND $DOWNLOAD_SILENT $DOWNLOAD_REDIRECT ${DOWNLOAD_OUTPUT}- https://api.github.com/repos/khos2ow/hugo-wrapper/releases/latest`
286+
versionToDownload=`parse_json "$latest_release" "tag_name"`
287+
288+
$DOWNLOAD_COMMAND $DOWNLOAD_SILENT $DOWNLOAD_REDIRECT $DOWNLOAD_OUTPUT "hugow" "https://github.com/khos2ow/hugo-wrapper/releases/download/${versionToDownload}/hugow" &
285289
wait
286290
printf "[done]\n"
287291
chmod +x hugow

0 commit comments

Comments
 (0)