Skip to content

Commit 507f559

Browse files
authored
Merge pull request #19 from virgilwashere/master
Set permissions on $abs_profiled and shellcheck config
2 parents 25d7dad + ec34412 commit 507f559

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/usr/bin/env sh
22

33
git add "$(./sha256-update.sh)"
44

sha256-update.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/sh
1+
#!/usr/bin/env sh
22

33
out=update-golang.sh.sha256
44

shellcheck.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
shellcheck -e SC2153,SC2016 pre-commit sha256-update.sh update-golang.sh

update-golang.sh

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# update-golang is a script to easily fetch and install new Golang releases
44
#
55
# Home: https://github.com/udhos/update-golang
66
#
77
# PIPETHIS_AUTHOR udhos
88

9+
# ignore runtime environment variables
10+
# shellcheck disable=SC2153
911
version=0.20
1012

1113
set -o pipefail
@@ -272,19 +274,21 @@ profile_path_add() {
272274
profile_path_remove
273275

274276
msg profile_path_add: issuing new "$abs_gobin" to "$abs_profiled"
275-
local dont_edit=";# DOT NOT EDIT: installed by $path_mark"
277+
local dont_edit=";# DO NOT EDIT: installed by $path_mark"
276278
echo "export PATH=\$PATH:$abs_gobin $dont_edit" >> "$abs_profiled"
277279

278280
local user_gobin=
279281
[ -n "$GOPATH" ] && user_gobin=$(echo "$GOPATH" | awk -F: '{print $1}')/bin
280-
[ -z "$user_gobin" ] && user_gobin='$HOME/go/bin'
282+
# shellcheck disable=SC2016
283+
[ -z "$user_gobin" ] && user_gobin='$HOME/go/bin' ;# we want $HOME literal
281284
msg profile_path_add: issuing "$user_gobin" to "$abs_profiled"
282285
echo "export PATH=\$PATH:$user_gobin $dont_edit" >> "$abs_profiled"
283286

284287
if [ "$abs_goroot" != $default_goroot ]; then
285288
msg profile_path_add: setting up custom GOROOT="$abs_goroot" to "$abs_profiled"
286289
echo "export GOROOT=$abs_goroot $dont_edit" >> "$abs_profiled"
287290
fi
291+
chmod 755 "$abs_profiled"
288292
}
289293

290294
running_as_root() {

update-golang.sh.sha256

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2d890dfe07eab0700d14ccc282c1dd2ec737095e907b4cad3c71d1ec423d0e31 update-golang.sh
1+
6beb10c818f6dfc52d03803672b526acfabcb9b3fab231996e62366b95c0dd64 update-golang.sh

0 commit comments

Comments
 (0)