Skip to content
This repository was archived by the owner on Jan 25, 2022. It is now read-only.

Commit e4a83cb

Browse files
committed
Made more silent.
1 parent 1589ff8 commit e4a83cb

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

commands/self-update

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@ WPLIB_BOX_CLI_DIR="/opt/box"
1313
DEFAULT_VERSION="master"
1414

1515

16+
# Determine version to run.
17+
if [ "$1" == "" ]
18+
then
19+
VERSION="`cat ${WPLIB_BOX_CLI_DIR}/version`"
20+
if [ "$DEFAULT_VERSION" == "" ]
21+
then
22+
VERSION=${DEFAULT_VERSION}
23+
fi
24+
else
25+
VERSION="$1"
26+
fi
27+
28+
1629
################################################################################
1730
# Pull from GitHub.
1831
if [ ! -d ${WPLIB_BOX_CLI_DIR} ]
@@ -36,7 +49,7 @@ git diff --name-only | xargs git checkout -q
3649
# Add any locally updated and non-tracked files to the cache.
3750
git add -A .
3851
# Finally checkout the branch/tag.
39-
git checkout -q ${VERSION}
52+
git checkout -q ${VERSION} 2>/dev/null
4053
echo "Done"
4154
rm /tmp/self-update.$$
4255
EOF

0 commit comments

Comments
 (0)