Skip to content

Commit 35e8616

Browse files
committed
trunk fmt
1 parent 7a97b0c commit 35e8616

File tree

4 files changed

+33
-14
lines changed

4 files changed

+33
-14
lines changed

.shellcheckrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
enable=all
2-
disable=SC2154 # Disabled because it's disabled by trunk
2+
disable=SC2154 # Disabled because it's disabled in trunk by default
3+
disable=SC2312 # Disabled because we often don't need return values

cmd/cloudexec/cancel.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
func CancelJob(config config.Config, existingState *state.State, job *state.Job, force bool) error {
1414
if job.Status != state.Provisioning && job.Status != state.Running {
1515
log.Info("Job %v is not running, it is %s", job.ID, job.Status)
16-
return nil
16+
return nil
1717
}
1818
log.Warn("Destroying droplet %s associated with job %v: IP=%v | CreatedAt=%s", job.Droplet.Name, job.ID, job.Droplet.IP, job.Droplet.Created)
1919
if !force { // Ask for confirmation before cleaning this job if no force flag

cmd/cloudexec/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func main() {
129129
return err
130130
}
131131
err = Launch(config, dropletSize, dropletRegion, lc)
132-
return err
132+
return err
133133
},
134134
},
135135

packer/provision.sh

+29-11
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ set -e
66
## Helper Functions
77

88
function github_api {
9-
project="$1"
10-
github_api="https://api.github.com/repos/${project}/releases/latest"
11-
curl -s "$github_api"
9+
project="$1"
10+
github_api="https://api.github.com/repos/${project}/releases/latest"
11+
curl -s "${github_api}"
1212
}
1313

1414
function get_latest_version {
15-
github_api "$1" | jq '.tag_name' | tr -d 'v' | tr -d '"'
15+
github_api "$1" | jq '.tag_name' | tr -d 'v' | tr -d '"'
1616
}
1717

1818
function get_latest_artifact {
19-
github_api "$1" | jq '.assets[] | select(.name | test("linux")) | .browser_download_url' | tr -d '"'
19+
github_api "$1" | jq '.assets[] | select(.name | test("linux")) | .browser_download_url' | tr -d '"'
2020
}
2121

2222
########################################
@@ -32,8 +32,14 @@ export DEBIAN_FRONTEND=noninteractive
3232
apt-get update
3333
apt-get install -y jq s3cmd tmux python3-pip python3-venv
3434

35-
echo "Installing doctl v$(get_latest_version "digitalocean/doctl")..."
36-
curl -fsSL -o /tmp/doctl.tar.gz "$(get_latest_artifact "digitalocean/doctl" | grep "amd64")"
35+
echo "Installing doctl v$(
36+
set -e
37+
get_latest_version "digitalocean/doctl"
38+
)..."
39+
curl -fsSL -o /tmp/doctl.tar.gz "$(
40+
set -e
41+
get_latest_artifact "digitalocean/doctl" | grep "amd64"
42+
)"
3743
tar -xzf /tmp/doctl.tar.gz -C /tmp
3844
mv /tmp/doctl /usr/local/bin
3945
rm /tmp/doctl.tar.gz
@@ -48,16 +54,28 @@ source ~/venv/bin/activate
4854
pip3 install solc-select slither-analyzer crytic-compile
4955
solc-select use latest --always-install
5056

51-
echo "Installing echidna v$(get_latest_version "crytic/echidna")..."
52-
curl -fsSL -o /tmp/echidna.tar.gz "$(get_latest_artifact "crytic/echidna" | grep -v "sigstore")"
57+
echo "Installing echidna v$(
58+
set -e
59+
get_latest_version "crytic/echidna"
60+
)..."
61+
curl -fsSL -o /tmp/echidna.tar.gz "$(
62+
set -e
63+
get_latest_artifact "crytic/echidna" | grep -v "sigstore"
64+
)"
5365
tar -xzf /tmp/echidna.tar.gz -C /tmp
5466
mv /tmp/echidna /usr/local/bin
5567
chmod +x /usr/local/bin/echidna
5668
rm /tmp/echidna.tar.gz
5769
echo "Done installing: $(echidna --version)"
5870

59-
echo "Installing medusa v$(get_latest_version "crytic/medusa")..."
60-
curl -fsSL -o /tmp/medusa.tar.gz "$(get_latest_artifact "crytic/medusa" | grep -v "sigstore")"
71+
echo "Installing medusa v$(
72+
set -e
73+
get_latest_version "crytic/medusa"
74+
)..."
75+
curl -fsSL -o /tmp/medusa.tar.gz "$(
76+
set -e
77+
get_latest_artifact "crytic/medusa" | grep -v "sigstore"
78+
)"
6179
tar -xzf /tmp/medusa.tar.gz -C /tmp
6280
sudo mv /tmp/medusa /usr/local/bin
6381
chmod +x /usr/local/bin/medusa

0 commit comments

Comments
 (0)