Skip to content

Commit

Permalink
Switch to /bin/sh
Browse files Browse the repository at this point in the history
Related changes:
* Fix checks for gofmt and gofmt errors
* Use $() over ``

Should make resolving aws#12 easier
  • Loading branch information
skwashd committed Oct 24, 2021
1 parent 142dbbe commit c1ec771
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Tools/src/checkstyle.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash
#!/bin/sh
echo "Run checkstyle script"

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

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

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

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

0 comments on commit c1ec771

Please sign in to comment.