Skip to content

Commit f98c9b1

Browse files
committed
shfmt
1 parent c20dbed commit f98c9b1

File tree

5 files changed

+103
-85
lines changed

5 files changed

+103
-85
lines changed

bin/nodenv-prune-version-defs

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -54,29 +54,36 @@ shopt -u nullglob
5454
# Provide nodenv completions
5555
while [ $# -gt 0 ]; do
5656
case "$1" in
57-
--complete )
58-
echo --destination
59-
echo --dry-run
60-
echo --force
61-
echo --help
62-
echo --verbose
63-
exit ;;
64-
-d | --destination )
65-
shift
66-
# overwrite the defs write target
67-
NODE_BUILD_DEFINITIONS="$(abs_dirname "${1%/}/"):${NODE_BUILD_DEFINITIONS}" ;;
68-
-f | --force )
69-
FORCE=true ;;
70-
-h | --help )
71-
exec nodenv-help update-version-defs ;;
72-
-n | --dry-run )
73-
DRY_RUN=true
74-
VERBOSE=true ;;
75-
-v | --verbose )
76-
VERBOSE=true ;;
77-
* )
78-
nodenv-help --usage update-version-defs >&2
79-
exit 1;;
57+
--complete)
58+
echo --destination
59+
echo --dry-run
60+
echo --force
61+
echo --help
62+
echo --verbose
63+
exit
64+
;;
65+
-d | --destination)
66+
shift
67+
# overwrite the defs write target
68+
NODE_BUILD_DEFINITIONS="$(abs_dirname "${1%/}/"):${NODE_BUILD_DEFINITIONS}"
69+
;;
70+
-f | --force)
71+
FORCE=true
72+
;;
73+
-h | --help)
74+
exec nodenv-help update-version-defs
75+
;;
76+
-n | --dry-run)
77+
DRY_RUN=true
78+
VERBOSE=true
79+
;;
80+
-v | --verbose)
81+
VERBOSE=true
82+
;;
83+
*)
84+
nodenv-help --usage update-version-defs >&2
85+
exit 1
86+
;;
8087
esac
8188
shift
8289
done

bin/nodenv-update-version-defs

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -75,37 +75,44 @@ unset PATTERN
7575
# Provide nodenv completions
7676
while [ $# -gt 0 ]; do
7777
case "$1" in
78-
--complete )
79-
echo --destination
80-
echo --dry-run
81-
echo --force
82-
echo --regexp
83-
echo --nodejs
84-
echo --nodejs-pre
85-
echo --nodejs-nightly
86-
echo --chakracore
87-
echo --chakracore-pre
88-
echo --chakracore-nightly
89-
echo --graal
90-
exit ;;
91-
-d | --destination )
92-
shift
93-
# overwrite the defs write target
94-
NODE_BUILD_DEFINITIONS="$(abs_dirname "${1%/}/"):${NODE_BUILD_DEFINITIONS}" ;;
95-
-n | --dry-run)
96-
DRY_RUN=true ;;
97-
-f | --force)
98-
FORCE=true ;;
99-
-e | --regexp)
100-
PATTERN=$2
101-
shift ;;
102-
--nodejs | --nodejs-pre | --nodejs-nightly | \
78+
--complete)
79+
echo --destination
80+
echo --dry-run
81+
echo --force
82+
echo --regexp
83+
echo --nodejs
84+
echo --nodejs-pre
85+
echo --nodejs-nightly
86+
echo --chakracore
87+
echo --chakracore-pre
88+
echo --chakracore-nightly
89+
echo --graal
90+
exit
91+
;;
92+
-d | --destination)
93+
shift
94+
# overwrite the defs write target
95+
NODE_BUILD_DEFINITIONS="$(abs_dirname "${1%/}/"):${NODE_BUILD_DEFINITIONS}"
96+
;;
97+
-n | --dry-run)
98+
DRY_RUN=true
99+
;;
100+
-f | --force)
101+
FORCE=true
102+
;;
103+
-e | --regexp)
104+
PATTERN=$2
105+
shift
106+
;;
107+
--nodejs | --nodejs-pre | --nodejs-nightly | \
103108
--chakracore | --chakracore-pre | --chakracore-nightly | \
104-
--graal )
105-
SCRAPERS+=("${1#--}") ;;
106-
* )
107-
nodenv-help --usage update-version-defs >&2
108-
exit 1;;
109+
--graal)
110+
SCRAPERS+=("${1#--}")
111+
;;
112+
*)
113+
nodenv-help --usage update-version-defs >&2
114+
exit 1
115+
;;
109116
esac
110117
shift
111118
done

script/commit-definitions

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ IFS=$'\n\t'
1515
cd "$(git rev-parse --show-toplevel)" || exit
1616

1717
git ls-files --others --exclude-standard -- share/node-build |
18-
while read -r node_def; do
19-
node_name=${node_def##*/}
20-
git add -- "$node_def"
21-
git commit --quiet --message "$node_name" --message "Created with \`npm run submit-definitions\`." --only -- "$node_def"
22-
echo "$node_name"
23-
done
18+
while read -r node_def; do
19+
node_name=${node_def##*/}
20+
git add -- "$node_def"
21+
git commit --quiet --message "$node_name" --message "Created with \`npm run submit-definitions\`." --only -- "$node_def"
22+
echo "$node_name"
23+
done

script/lts-lint-definitions

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ TODAY=$(date -u +'%F')
2222

2323
for arg in "$@"; do
2424
case "$arg" in
25-
--fix) FIX=1;;
26-
*) DIR=$arg;;
25+
--fix) FIX=1 ;;
26+
*) DIR=$arg ;;
2727
esac
2828
done
2929

@@ -87,7 +87,7 @@ prepend_message() {
8787
local file=$2
8888

8989
sed -e "1 i\\
90-
$msg" "$file" 1<> "$file"
90+
$msg" "$file" 1<>"$file"
9191
}
9292

9393
assert_message() {
@@ -116,8 +116,10 @@ assert_warnings() {
116116

117117
echo "v$version maint: $maint_date eol: $eol_date" >&2
118118
{
119-
if past "$eol_date"; then assert_message eol "$version"
120-
elif past "$maint_date"; then assert_message lts "$version"
119+
if past "$eol_date"; then
120+
assert_message eol "$version"
121+
elif past "$maint_date"; then
122+
assert_message lts "$version"
121123
fi
122124
} || status=$?
123125
done

script/verify-definitions

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set -eufo pipefail
88
IFS=$'\n\t'
99

1010
help_text() {
11-
sed -ne '/^#/!q;s/.\{1,2\}//;1d;p' < "$0"
11+
sed -ne '/^#/!q;s/.\{1,2\}//;1d;p' <"$0"
1212
}
1313

1414
compute_sha2() {
@@ -27,7 +27,7 @@ download_and_verify() {
2727
local file="$2"
2828
local expected="$3"
2929
download_package "$url" "$file" || return $?
30-
checksum="$(compute_sha2 < "$file")"
30+
checksum="$(compute_sha2 <"$file")"
3131
if [ "$checksum" != "$expected" ]; then
3232
{
3333
echo "Error: $url doesn't match its checksum:"
@@ -64,7 +64,7 @@ verify() {
6464
url="${url%#*}"
6565
echo "Verifying checksum for $url"
6666
file="${TMPDIR:-/tmp}/$checksum"
67-
download_and_verify "$url" "$file" "$checksum" || (( status += 1))
67+
download_and_verify "$url" "$file" "$checksum" || ((status += 1))
6868
done < <(xargs cat | extract_urls)
6969

7070
if [ "$status" != 0 ]; then
@@ -74,23 +74,25 @@ verify() {
7474
}
7575

7676
case "${1-}" in
77-
'' )
78-
{ echo "COMMIT_RANGE or FILES required"
79-
help_text
80-
} >&2
81-
exit 1;;
82-
-h | --help )
77+
'')
78+
{
79+
echo "COMMIT_RANGE or FILES required"
8380
help_text
84-
;;
85-
- )
86-
verify
87-
;;
88-
-- )
89-
echo "$@" | verify
90-
;;
91-
* )
92-
echo "Verifying changes from $1"
93-
changed_files "$1"
94-
potentially_new_packages "$1" | verify
95-
;;
81+
} >&2
82+
exit 1
83+
;;
84+
-h | --help)
85+
help_text
86+
;;
87+
-)
88+
verify
89+
;;
90+
--)
91+
echo "$@" | verify
92+
;;
93+
*)
94+
echo "Verifying changes from $1"
95+
changed_files "$1"
96+
potentially_new_packages "$1" | verify
97+
;;
9698
esac

0 commit comments

Comments
 (0)