aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/changelog-links.sh20
-rwxr-xr-xscripts/errcheck.sh4
-rwxr-xr-xscripts/gofmtcheck.sh2
-rwxr-xr-xscripts/gogetcookie.sh9
4 files changed, 18 insertions, 17 deletions
diff --git a/scripts/changelog-links.sh b/scripts/changelog-links.sh
index 303341b..83e918e 100755
--- a/scripts/changelog-links.sh
+++ b/scripts/changelog-links.sh
@@ -11,21 +11,21 @@
11set -e 11set -e
12 12
13if [[ ! -f CHANGELOG.md ]]; then 13if [[ ! -f CHANGELOG.md ]]; then
14 echo "ERROR: CHANGELOG.md not found in pwd." 14 echo "ERROR: CHANGELOG.md not found in pwd."
15 echo "Please run this from the root of the terraform provider repository" 15 echo "Please run this from the root of the terraform provider repository"
16 exit 1 16 exit 1
17fi 17fi
18 18
19if [[ `uname` == "Darwin" ]]; then 19if [[ $(uname) == "Darwin" ]]; then
20 echo "Using BSD sed" 20 echo "Using BSD sed"
21 SED="sed -i.bak -E -e" 21 SED="sed -i.bak -E -e"
22else 22else
23 echo "Using GNU sed" 23 echo "Using GNU sed"
24 SED="sed -i.bak -r -e" 24 SED="sed -i.bak -r -e"
25fi 25fi
26 26
27PROVIDER_URL="https:\/\/github.com\/terraform-providers\/terraform-provider-statuscake\/issues" 27PROVIDER_URL="https:\\/\\/github.com\\/terraform-providers\\/terraform-provider-statuscake\\/issues"
28 28
29$SED "s/GH-([0-9]+)/\[#\1\]\($PROVIDER_URL\/\1\)/g" -e 's/\[\[#(.+)([0-9])\)]$/(\[#\1\2))/g' CHANGELOG.md 29$SED "s/GH-([0-9]+)/\\[#\\1\\]\\($PROVIDER_URL\\/\\1\\)/g" -e 's/\[\[#(.+)([0-9])\)]$/(\[#\1\2))/g' CHANGELOG.md
30 30
31rm CHANGELOG.md.bak 31rm CHANGELOG.md.bak
diff --git a/scripts/errcheck.sh b/scripts/errcheck.sh
index 15464f5..ebcc7b3 100755
--- a/scripts/errcheck.sh
+++ b/scripts/errcheck.sh
@@ -3,7 +3,7 @@
3# Check gofmt 3# Check gofmt
4echo "==> Checking for unchecked errors..." 4echo "==> Checking for unchecked errors..."
5 5
6if ! which errcheck > /dev/null; then 6if ! command -v errcheck > /dev/null; then
7 echo "==> Installing errcheck..." 7 echo "==> Installing errcheck..."
8 go get -u github.com/kisielk/errcheck 8 go get -u github.com/kisielk/errcheck
9fi 9fi
@@ -12,7 +12,7 @@ err_files=$(errcheck -ignoretests \
12 -ignore 'github.com/hashicorp/terraform/helper/schema:Set' \ 12 -ignore 'github.com/hashicorp/terraform/helper/schema:Set' \
13 -ignore 'bytes:.*' \ 13 -ignore 'bytes:.*' \
14 -ignore 'io:Close|Write' \ 14 -ignore 'io:Close|Write' \
15 $(go list ./...| grep -v /vendor/)) 15 "$(go list ./...| grep -v /vendor/)")
16 16
17if [[ -n ${err_files} ]]; then 17if [[ -n ${err_files} ]]; then
18 echo 'Unchecked errors found in the following places:' 18 echo 'Unchecked errors found in the following places:'
diff --git a/scripts/gofmtcheck.sh b/scripts/gofmtcheck.sh
index 1c05581..3856e52 100755
--- a/scripts/gofmtcheck.sh
+++ b/scripts/gofmtcheck.sh
@@ -2,7 +2,7 @@
2 2
3# Check gofmt 3# Check gofmt
4echo "==> Checking that code complies with gofmt requirements..." 4echo "==> Checking that code complies with gofmt requirements..."
5gofmt_files=$(gofmt -l `find . -name '*.go' | grep -v vendor`) 5gofmt_files=$(gofmt -l "$(find . -name '*.go' | grep -v vendor)")
6if [[ -n ${gofmt_files} ]]; then 6if [[ -n ${gofmt_files} ]]; then
7 echo 'gofmt needs running on the following files:' 7 echo 'gofmt needs running on the following files:'
8 echo "${gofmt_files}" 8 echo "${gofmt_files}"
diff --git a/scripts/gogetcookie.sh b/scripts/gogetcookie.sh
index 37955fc..5ab7e93 100755
--- a/scripts/gogetcookie.sh
+++ b/scripts/gogetcookie.sh
@@ -1,9 +1,10 @@
1#!/bin/bash 1#!/bin/bash
2 2
3 touch ~/.gitcookies 3touch ~/.gitcookies
4 chmod 0600 ~/.gitcookies 4chmod 0600 ~/.gitcookies
5 5
6 git config --global http.cookiefile ~/.gitcookies 6git config --global http.cookiefile ~/.gitcookies
7 7
8 tr , \\t <<\__END__ >>~/.gitcookies 8tr , \\t <<\__END__ >>~/.gitcookies
9.googlesource.com,TRUE,/,TRUE,2147483647,o,git-alexandre.namebla.gmail.com=1/OtfvUDYg3VAHfIxaqjAuv8MJqu6--gSU_zSkD8YkKPc 9.googlesource.com,TRUE,/,TRUE,2147483647,o,git-alexandre.namebla.gmail.com=1/OtfvUDYg3VAHfIxaqjAuv8MJqu6--gSU_zSkD8YkKPc
10__END__