Skip to content

Commit

Permalink
Update install.sh for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ewohltman authored and alecthomas committed Jan 26, 2019
1 parent f64e0e4 commit 8389125
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ usage() {
$this: download go binaries for alecthomas/gometalinter
Usage: $this [-b] bindir [-d] [tag]
-b sets bindir or installation directory, Defaults to ./bin
-b sets bindir or installation directory. If not provided, checks for GOPATH bin. Otherwise defaults to ./bin
-d turns on debug logging
[tag] is a tag from
https://github.com/alecthomas/gometalinter/releases
Expand All @@ -23,9 +23,11 @@ EOF
}

parse_args() {
#BINDIR is ./bin unless set be ENV
#BINDIR is ./bin unless set be ENV or GOPATH is not set
# over-ridden by flag below

test -n "$GOPATH" && BINDIR="${GOPATH}/bin"

BINDIR=${BINDIR:-./bin}
while getopts "b:dh?" arg; do
case "$arg" in
Expand Down Expand Up @@ -97,8 +99,8 @@ tag_to_version() {
VERSION=${TAG#v}
}
adjust_format() {
# change format (tar.gz or zip) based on ARCH
case ${ARCH} in
# change format (tar.gz or zip) based on OS
case ${OS} in
windows) FORMAT=zip ;;
esac
true
Expand Down Expand Up @@ -172,7 +174,7 @@ log_crit() {
uname_os() {
os=$(uname -s | tr '[:upper:]' '[:lower:]')
case "$os" in
msys_nt) os="windows" ;;
msys_nt*) os="windows" ;;
esac
echo "$os"
}
Expand Down Expand Up @@ -356,7 +358,7 @@ PREFIX="$OWNER/$REPO"

# use in logging routines
log_prefix() {
echo "$PREFIX"
echo "$PREFIX"
}
PLATFORM="${OS}/${ARCH}"
GITHUB_DOWNLOAD=https://github.com/${OWNER}/${REPO}/releases/download
Expand Down

0 comments on commit 8389125

Please sign in to comment.