Skip to content

Commit b00684d

Browse files
committed
Switch to /bin/sh
Related changes: * Fix checks for gofmt and gofmt errors * Use $() over `` Should make resolving #12 easier
1 parent 1c9b600 commit b00684d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Tools/src/checkstyle.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
#!/usr/bin/env bash
1+
#!/bin/sh
22
echo "Run checkstyle script"
33

44
# run gofmt
55
echo "Run 'gofmt'"
6-
unformatted=$(gofmt -l `pwd`/src/)
7-
if [[ -n $unformatted ]]; then
6+
unformatted=$(gofmt -l $(pwd)/src/)
7+
if [ -n "$unformatted" ]; then
88
echo >&2 "Error: Found files not formatted by gofmt"
99
for fi in $unformatted; do
1010
echo >&2 $fi
@@ -15,11 +15,11 @@ fi
1515

1616
# run goimports
1717
echo "Try update 'goimports'"
18-
GOPATH=`pwd`/Tools go get golang.org/x/tools/cmd/goimports
18+
GOPATH=$(pwd)/Tools go get golang.org/x/tools/cmd/goimports
1919

2020
echo "Run 'goimports'"
21-
unformatted=$(Tools/bin/goimports -l `pwd`/src/)
22-
if [[ -n $unformatted ]]; then
21+
unformatted=$(Tools/bin/goimports -l $(pwd)/src/)
22+
if [ -n "$unformatted" ]; then
2323
echo >&2 "Error: Found files not formatted by goimports"
2424
for f in $unformatted; do
2525
echo >&2 $f
@@ -29,5 +29,5 @@ if [[ -n $unformatted ]]; then
2929
fi
3030

3131
echo "Run 'go vet'"
32-
ln -s `pwd` `pwd`/vendor/src/github.com/aws/SSMCLI
32+
ln -s $(pwd) $(pwd)/vendor/src/github.com/aws/SSMCLI
3333
go vet ./src/...

0 commit comments

Comments
 (0)