Skip to content

Commit d053898

Browse files
committed
chore: update formatting w/new prettier sh plugin
1 parent 0ba53b6 commit d053898

15 files changed

+45
-46
lines changed

ci/build/build-packages.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ release_gcp() {
4040
# Generates deb and rpm packages.
4141
release_nfpm() {
4242
local nfpm_config
43-
nfpm_config="$(envsubst < ./ci/build/nfpm.yaml)"
43+
nfpm_config="$(envsubst <./ci/build/nfpm.yaml)"
4444

4545
# The underscores are convention for .deb.
4646
nfpm pkg -f <(echo "$nfpm_config") --target "release-packages/code-server_${VERSION}_$ARCH.deb"

ci/build/build-release.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ bundle_code_server() {
4949

5050
# Adds the commit to package.json
5151
jq --slurp '.[0] * .[1]' package.json <(
52-
cat << EOF
52+
cat <<EOF
5353
{
5454
"commit": "$(git rev-parse HEAD)",
5555
"scripts": {
5656
"postinstall": "./postinstall.sh"
5757
}
5858
}
5959
EOF
60-
) > "$RELEASE_PATH/package.json"
60+
) >"$RELEASE_PATH/package.json"
6161
rsync yarn.lock "$RELEASE_PATH"
6262
rsync ci/build/npm-postinstall.sh "$RELEASE_PATH/postinstall.sh"
6363

@@ -89,18 +89,18 @@ bundle_vscode() {
8989

9090
# Adds the commit and date to product.json
9191
jq --slurp '.[0] * .[1]' "$VSCODE_SRC_PATH/product.json" <(
92-
cat << EOF
92+
cat <<EOF
9393
{
9494
"commit": "$(git rev-parse HEAD)",
9595
"date": $(jq -n 'now | todate')
9696
}
9797
EOF
98-
) > "$VSCODE_OUT_PATH/product.json"
98+
) >"$VSCODE_OUT_PATH/product.json"
9999

100100
# We remove the scripts field so that later on we can run
101101
# yarn to fetch node_modules if necessary without build scripts running.
102102
# We cannot use --no-scripts because we still want dependent package scripts to run.
103-
jq 'del(.scripts)' < "$VSCODE_SRC_PATH/package.json" > "$VSCODE_OUT_PATH/package.json"
103+
jq 'del(.scripts)' <"$VSCODE_SRC_PATH/package.json" >"$VSCODE_OUT_PATH/package.json"
104104

105105
pushd "$VSCODE_OUT_PATH"
106106
symlink_asar

ci/build/build-standalone-release.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ main() {
1212
# we use the same version it's using so we instead run a script with yarn that
1313
# will print the path to node.
1414
local node_path
15-
node_path="$(yarn -s node <<< 'console.info(process.execPath)')"
15+
node_path="$(yarn -s node <<<'console.info(process.execPath)')"
1616

1717
mkdir -p "$RELEASE_PATH/bin"
1818
rsync ./ci/build/code-server.sh "$RELEASE_PATH/bin/code-server"

ci/build/code-server.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ _realpath() {
1111
cd "$(dirname "$script")"
1212

1313
while [ -L "$(basename "$script")" ]; do
14-
if [ -L "./node" ] && [ -L "./code-server" ] &&
15-
[ -f "package.json" ] &&
16-
cat package.json | grep -q '^ "name": "code-server",$'; then
14+
if [ -L "./node" ] && [ -L "./code-server" ] \
15+
&& [ -f "package.json" ] \
16+
&& cat package.json | grep -q '^ "name": "code-server",$'; then
1717
echo "***** Please use the script in bin/code-server instead!" >&2
1818
echo "***** This script will soon be removed!" >&2
1919
echo "***** See the release notes at https://github.com/cdr/code-server/releases/tag/v3.4.0" >&2

ci/build/release-github-draft.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ main() {
1010
hub release create \
1111
--file - \
1212
-t "$(git rev-parse HEAD)" \
13-
--draft "v$VERSION" << EOF
13+
--draft "v$VERSION" <<EOF
1414
v$VERSION
1515
1616
VS Code v$(vscode_version)

ci/dev/fmt.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ main() {
2222
git ls-files "${prettierExts[@]}" | grep -v "lib/vscode" | grep -v 'helm-chart'
2323
)
2424

25-
doctoc --title '# FAQ' docs/FAQ.md > /dev/null
26-
doctoc --title '# Setup Guide' docs/guide.md > /dev/null
27-
doctoc --title '# Install' docs/install.md > /dev/null
28-
doctoc --title '# npm Install Requirements' docs/npm.md > /dev/null
29-
doctoc --title '# Contributing' docs/CONTRIBUTING.md > /dev/null
30-
doctoc --title '# Contributor Covenant Code of Conduct' docs/CODE_OF_CONDUCT.md > /dev/null
31-
doctoc --title '# iPad' docs/ipad.md > /dev/null
25+
doctoc --title '# FAQ' docs/FAQ.md >/dev/null
26+
doctoc --title '# Setup Guide' docs/guide.md >/dev/null
27+
doctoc --title '# Install' docs/install.md >/dev/null
28+
doctoc --title '# npm Install Requirements' docs/npm.md >/dev/null
29+
doctoc --title '# Contributing' docs/CONTRIBUTING.md >/dev/null
30+
doctoc --title '# Contributor Covenant Code of Conduct' docs/CODE_OF_CONDUCT.md >/dev/null
31+
doctoc --title '# iPad' docs/ipad.md >/dev/null
3232

3333
if [[ ${CI-} && $(git ls-files --other --modified --exclude-standard) ]]; then
3434
echo "Files need generation or are formatted incorrectly:"

ci/dev/gen_icons.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ main() {
3535
# This escapes all newlines so that sed will accept them.
3636
favicon_dark_style="$(printf "%s\n" "$favicon_dark_style" | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/\\n/g')"
3737
sed "$(
38-
cat -n << EOF
38+
cat -n <<EOF
3939
s%<rect id="favicon"%$favicon_dark_style<rect id="favicon"%
4040
EOF
41-
)" favicon.svg > favicon-dark-support.svg
41+
)" favicon.svg >favicon-dark-support.svg
4242
}
4343

4444
main "$@"

ci/dev/lint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ main() {
88
stylelint $(git ls-files "*.css" | grep -v "lib/vscode")
99
tsc --noEmit --skipLibCheck
1010
shellcheck -e SC2046,SC2164,SC2154,SC1091,SC1090,SC2002 $(git ls-files "*.sh" | grep -v "lib/vscode")
11-
if command -v helm && helm kubeval --help > /dev/null; then
11+
if command -v helm && helm kubeval --help >/dev/null; then
1212
helm kubeval ci/helm-chart
1313
fi
1414

ci/dev/update-vscode.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ main() {
3333

3434
# Check if the remote exists
3535
# if it doesn't, we add it
36-
if ! git config remote.vscode.url > /dev/null; then
36+
if ! git config remote.vscode.url >/dev/null; then
3737
echo "Could not find 'vscode' as a remote"
3838
echo "Adding with: git remote add vscode https://github.com/microsoft/vscode.git"
3939
git remote add vscode https://github.com/microsoft/vscode.git
@@ -52,7 +52,7 @@ main() {
5252
fi
5353

5454
# Check that they have jq installed
55-
if ! command -v jq &> /dev/null; then
55+
if ! command -v jq &>/dev/null; then
5656
echo "jq could not be found."
5757
echo "We use this when looking up the exact version to update to in the package.json in VS Code."
5858
echo -e "See docs here: https://stedolan.github.io/jq/download/"
@@ -71,7 +71,7 @@ main() {
7171
git fetch vscode
7272

7373
# Check if GitHub CLI is installed
74-
if ! command -v gh &> /dev/null; then
74+
if ! command -v gh &>/dev/null; then
7575
echo "GitHub CLI could not be found."
7676
echo "If you install it before you run this script next time, we'll open a draft PR for you!"
7777
echo -e "See docs here: https://github.com/cli/cli#installation\n"

ci/lib.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
set -euo pipefail
33

44
pushd() {
5-
builtin pushd "$@" > /dev/null
5+
builtin pushd "$@" >/dev/null
66
}
77

88
popd() {
9-
builtin popd > /dev/null
9+
builtin popd >/dev/null
1010
}
1111

1212
pkg_json_version() {
@@ -75,7 +75,7 @@ download_artifact() {
7575
local tmp_file
7676
tmp_file="$(mktemp)"
7777

78-
curl -fsSL "$(get_artifact_url "$artifact_name")" > "$tmp_file"
78+
curl -fsSL "$(get_artifact_url "$artifact_name")" >"$tmp_file"
7979
unzip -q -o "$tmp_file" -d "$dst"
8080
rm "$tmp_file"
8181
}

ci/release-image/entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -eu
66
eval "$(fixuid -q)"
77

88
if [ "${DOCKER_USER-}" ] && [ "$DOCKER_USER" != "$USER" ]; then
9-
echo "$DOCKER_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null
9+
echo "$DOCKER_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd >/dev/null
1010
# Unfortunately we cannot change $HOME as we cannot move any bind mounts
1111
# nor can we bind mount $HOME into a new home as that requires a privileged container.
1212
sudo usermod --login "$DOCKER_USER" coder

ci/steps/build-docker-image.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ main() {
88
./ci/release-image/build.sh
99

1010
mkdir -p release-images
11-
docker save "codercom/code-server-$ARCH:$VERSION" > "release-images/code-server-$ARCH-$VERSION.tar"
11+
docker save "codercom/code-server-$ARCH:$VERSION" >"release-images/code-server-$ARCH-$VERSION.tar"
1212
}
1313

1414
main "$@"

ci/steps/publish-npm.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ main() {
66
source ./ci/lib.sh
77

88
if [[ ${CI-} ]]; then
9-
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
9+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >~/.npmrc
1010
fi
1111

1212
download_artifact npm-package ./release-npm-package

docs/CONTRIBUTING.md

+9-10
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
33
# Contributing
44

5-
- [Contributing](#contributing)
6-
- [Pull Requests](#pull-requests)
7-
- [Requirements](#requirements)
8-
- [Development Workflow](#development-workflow)
9-
- [Updating VS Code](#updating-vs-code)
10-
- [Notes about Changes](#notes-about-changes)
11-
- [Build](#build)
12-
- [Structure](#structure)
13-
- [Modifications to VS Code](#modifications-to-vs-code)
14-
- [Currently Known Issues](#currently-known-issues)
5+
- [Pull Requests](#pull-requests)
6+
- [Requirements](#requirements)
7+
- [Development Workflow](#development-workflow)
8+
- [Updating VS Code](#updating-vs-code)
9+
- [Notes about Changes](#notes-about-changes)
10+
- [Build](#build)
11+
- [Structure](#structure)
12+
- [Modifications to VS Code](#modifications-to-vs-code)
13+
- [Currently Known Issues](#currently-known-issues)
1514

1615
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
1716

install.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ usage() {
1313
"
1414
fi
1515

16-
cath << EOF
16+
cath <<EOF
1717
Installs code-server for Linux, macOS and FreeBSD.
1818
It tries to use the system package manager if possible.
1919
After successful installation it explains how to start using code-server.
@@ -81,7 +81,7 @@ echo_latest_version() {
8181

8282
echo_npm_postinstall() {
8383
echoh
84-
cath << EOF
84+
cath <<EOF
8585
The npm package has been installed successfully!
8686
Please extend your path to use code-server:
8787
PATH="$NPM_BIN_DIR:\$PATH"
@@ -92,7 +92,7 @@ EOF
9292

9393
echo_standalone_postinstall() {
9494
echoh
95-
cath << EOF
95+
cath <<EOF
9696
Standalone release has been installed into $STANDALONE_INSTALL_PREFIX/lib/code-server-$VERSION
9797
Please extend your path to use code-server:
9898
PATH="$STANDALONE_INSTALL_PREFIX/bin:\$PATH"
@@ -103,7 +103,7 @@ EOF
103103

104104
echo_systemd_postinstall() {
105105
echoh
106-
cath << EOF
106+
cath <<EOF
107107
To have systemd start code-server now and restart on boot:
108108
sudo systemctl enable --now code-server@\$USER
109109
Or, if you don't want/need a background service you can run:
@@ -509,7 +509,7 @@ arch() {
509509
}
510510

511511
command_exists() {
512-
command -v "$@" > /dev/null
512+
command -v "$@" >/dev/null
513513
}
514514

515515
sh_c() {
@@ -571,7 +571,7 @@ prefix() {
571571
fifo="$(mktemp -d)/fifo"
572572
mkfifo "$fifo"
573573
sed -e "s#^#$PREFIX: #" "$fifo" &
574-
"$@" > "$fifo" 2>&1
574+
"$@" >"$fifo" 2>&1
575575
}
576576

577577
main "$@"

0 commit comments

Comments
 (0)