mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: Add .editorconfig, shfmt, shellcheck and subshell dir changes (#1649)
This commit is contained in:
+22
-16
@@ -2,23 +2,29 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
FILES="$(git ls-files --other --modified --exclude-standard)"
|
||||
if [[ "$FILES" != "" ]]; then
|
||||
mapfile -t files <<<"$FILES"
|
||||
SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
|
||||
PROJECT_ROOT=$(cd "$SCRIPT_DIR" && git rev-parse --show-toplevel)
|
||||
|
||||
echo "The following files contain unstaged changes:"
|
||||
echo
|
||||
for file in "${files[@]}"; do
|
||||
echo " - $file"
|
||||
done
|
||||
echo
|
||||
(
|
||||
cd "${PROJECT_ROOT}"
|
||||
|
||||
echo "These are the changes:"
|
||||
echo
|
||||
for file in "${files[@]}"; do
|
||||
git --no-pager diff "$file"
|
||||
done
|
||||
exit 1
|
||||
fi
|
||||
FILES="$(git ls-files --other --modified --exclude-standard)"
|
||||
if [[ "$FILES" != "" ]]; then
|
||||
mapfile -t files <<<"$FILES"
|
||||
|
||||
echo "The following files contain unstaged changes:"
|
||||
echo
|
||||
for file in "${files[@]}"; do
|
||||
echo " - $file"
|
||||
done
|
||||
echo
|
||||
|
||||
echo "These are the changes:"
|
||||
echo
|
||||
for file in "${files[@]}"; do
|
||||
git --no-pager diff "$file"
|
||||
done
|
||||
exit 1
|
||||
fi
|
||||
)
|
||||
exit 0
|
||||
|
||||
+8
-6
@@ -2,8 +2,8 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
PROJECT_ROOT="$(git rev-parse --show-toplevel)"
|
||||
cd "${PROJECT_ROOT}"
|
||||
SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
|
||||
PROJECT_ROOT=$(cd "$SCRIPT_DIR" && git rev-parse --show-toplevel)
|
||||
|
||||
echo '== Run "make build" before running this command to build binaries.'
|
||||
echo '== Without these binaries, workspaces will fail to start!'
|
||||
@@ -19,8 +19,10 @@ export CODER_DEV_ADMIN_PASSWORD=password
|
||||
# to kill both at the same time. For more details, see:
|
||||
# https://stackoverflow.com/questions/3004811/how-do-you-run-multiple-programs-in-parallel-from-a-bash-script
|
||||
(
|
||||
trap 'kill 0' SIGINT
|
||||
CODERV2_HOST=http://127.0.0.1:3000 INSPECT_XSTATE=true yarn --cwd=./site dev &
|
||||
go run -tags embed cmd/coder/main.go server --dev --tunnel=true &
|
||||
wait
|
||||
cd "${PROJECT_ROOT}"
|
||||
|
||||
trap 'kill 0' SIGINT
|
||||
CODERV2_HOST=http://127.0.0.1:3000 INSPECT_XSTATE=true yarn --cwd=./site dev &
|
||||
go run -tags embed cmd/coder/main.go server --dev --tunnel=true &
|
||||
wait
|
||||
)
|
||||
|
||||
+18
-12
@@ -1,17 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
cd "$(git rev-parse --show-toplevel)"
|
||||
|
||||
codesign -s $AC_APPLICATION_IDENTITY -f -v --timestamp --options runtime $1
|
||||
SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
|
||||
PROJECT_ROOT=$(cd "$SCRIPT_DIR" && git rev-parse --show-toplevel)
|
||||
|
||||
config="$(mktemp -d)/gon.json"
|
||||
jq -r --null-input --arg path "$(pwd)/$1" '{
|
||||
"notarize": [
|
||||
{
|
||||
"path": $path,
|
||||
"bundle_id": "com.coder.cli"
|
||||
}
|
||||
]
|
||||
}' > $config
|
||||
gon $config
|
||||
(
|
||||
cd "${PROJECT_ROOT}"
|
||||
|
||||
codesign -s "$AC_APPLICATION_IDENTITY" -f -v --timestamp --options runtime "$1"
|
||||
|
||||
config=$(mktemp -d)/gon.json
|
||||
jq -r --null-input --arg path "$(pwd)/$1" '{
|
||||
"notarize": [
|
||||
{
|
||||
"path": $path,
|
||||
"bundle_id": "com.coder.cli"
|
||||
}
|
||||
]
|
||||
}' >"$config"
|
||||
gon "$config"
|
||||
)
|
||||
|
||||
+31
-27
@@ -7,33 +7,37 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
PROJECT_ROOT=$(git rev-parse --show-toplevel)
|
||||
cd "$PROJECT_ROOT/site"
|
||||
SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
|
||||
PROJECT_ROOT=$(cd "$SCRIPT_DIR" && git rev-parse --show-toplevel)
|
||||
|
||||
yarn_flags=(
|
||||
# Do not execute install scripts
|
||||
# TODO: check if build works properly with this enabled
|
||||
# --ignore-scripts
|
||||
(
|
||||
cd "$PROJECT_ROOT/site"
|
||||
|
||||
# Check if existing node_modules are valid
|
||||
# TODO: determine if this is necessary
|
||||
# --check-files
|
||||
yarn_flags=(
|
||||
# Do not execute install scripts
|
||||
# TODO: check if build works properly with this enabled
|
||||
# --ignore-scripts
|
||||
|
||||
# Check if existing node_modules are valid
|
||||
# TODO: determine if this is necessary
|
||||
# --check-files
|
||||
)
|
||||
|
||||
if [ -n "${CI:-}" ]; then
|
||||
yarn_flags+=(
|
||||
# Install dependencies from lockfile, ensuring builds are fully
|
||||
# reproducible
|
||||
--frozen-lockfile
|
||||
# Suppress progress information
|
||||
--silent
|
||||
# Disable interactive prompts for build
|
||||
--non-interactive
|
||||
)
|
||||
fi
|
||||
|
||||
# Append whatever is specified on the command line
|
||||
yarn_flags+=("$@")
|
||||
|
||||
echo "+ yarn install ${yarn_flags[*]}"
|
||||
yarn install "${yarn_flags[@]}"
|
||||
)
|
||||
|
||||
if [ -n "${CI:-}" ]; then
|
||||
yarn_flags+=(
|
||||
# Install dependencies from lockfile, ensuring builds are fully
|
||||
# reproducible
|
||||
--frozen-lockfile
|
||||
# Suppress progress information
|
||||
--silent
|
||||
# Disable interactive prompts for build
|
||||
--non-interactive
|
||||
)
|
||||
fi
|
||||
|
||||
# Append whatever is specified on the command line
|
||||
yarn_flags+=("$@")
|
||||
|
||||
echo "+ yarn install ${yarn_flags[*]}"
|
||||
yarn install "${yarn_flags[@]}"
|
||||
|
||||
Reference in New Issue
Block a user