Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adopt shellcheck #502

Merged
merged 7 commits into from
Jul 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- [Docker](#docker)
- [Testing](#testing)
- [`godo` mocks](#godo-mocks)
- [Build Scripts](#build-scripts)
- [Releasing](#releasing)
- [Setup](#setup)
- [Cutting a release](#cutting-a-release)
Expand Down Expand Up @@ -90,6 +91,10 @@ When you upgrade `godo` you have to re-generate the mocks.
make mocks
```

### Build Scripts

If you modify the build scripts, use `make shellcheck` to check your changes.

## Releasing

### Setup
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ mocks:
@echo "update mocks"
scripts/regenmocks.sh

.PHONY: shellcheck
shellcheck:
@echo "analyze shell scripts"
scripts/shell_check.sh

# These builds are for convenience. This logic isn't used in the build-release process
my_d = $(shell pwd)
OUT_D = $(shell echo $${OUT_D:-$(my_d)/builds})
Expand Down
10 changes: 5 additions & 5 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/bash

set -eo pipefail
set -eou pipefail

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
OUT_DIR="$DIR/../out"
mkdir -p $OUT_DIR
mkdir -p "$OUT_DIR"

go build \
-o $OUT_DIR/doctl \
-ldflags "-X github.com/digitalocean/doctl/Build=`git rev-parse --short HEAD`" \
-o "$OUT_DIR/doctl" \
-ldflags "-X github.com/digitalocean/doctl/Build=$(git rev-parse --short HEAD)" \
github.com/digitalocean/doctl/cmd/doctl

chmod +x $OUT_DIR/doctl
chmod +x "$OUT_DIR/doctl"
Loading