Update shell code

Now it (mostly) passes shellcheck and is formatted with shfmt.
This commit is contained in:
Michael Wolf
2025-11-17 11:38:04 -06:00
parent 1a13fd0909
commit 2641a8d29d
11 changed files with 39 additions and 36 deletions

4
cmd
View File

@@ -6,7 +6,7 @@
set -eu set -eu
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
subcmd="$1" subcmd="$1"
@@ -16,6 +16,6 @@ subcmd="$1"
shift shift
echo will run "$DIR"/framework/cmd.d/"$subcmd" "$@" echo will run "$DIR"/framework/cmd.d/"$subcmd" "$@"
exec "$DIR"/framework/cmd.d/"$subcmd" "$@" exec "$DIR"/framework/cmd.d/"$subcmd" "$@"

View File

@@ -11,4 +11,4 @@ source "$check_dir"/../framework/shims/node.common
# $ROOT/cmd pnpm tsc --lib ES2023 --esModuleInterop -w $check_dir/app.ts # $ROOT/cmd pnpm tsc --lib ES2023 --esModuleInterop -w $check_dir/app.ts
# $ROOT/cmd pnpm tsc -w $check_dir/app.ts # $ROOT/cmd pnpm tsc -w $check_dir/app.ts
$ROOT/cmd pnpm tsc -w --project ./tsconfig.json $ROOT/cmd pnpm tsc --watch --project ./tsconfig.json

View File

@@ -2,7 +2,7 @@
set -eu set -eu
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$DIR" cd "$DIR"

View File

@@ -2,6 +2,6 @@
set -eu set -eu
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
"$DIR"/../shims/node "$@" "$DIR"/../shims/node "$@"

View File

@@ -2,6 +2,6 @@
set -eu set -eu
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
"$DIR"/../shims/pnpm "$@" "$DIR"/../shims/pnpm "$@"

View File

@@ -2,7 +2,7 @@
set -eu set -eu
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# figure out the platform we're on # figure out the platform we're on
@@ -11,11 +11,8 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# download $nodejs_version # download $nodejs_version
# verify its checksum against $nodejs_checksum # verify its checksum against $nodejs_checksum
cd "$DIR/../node"
"$DIR"/pnpm install
cd $DIR/../node
$DIR/pnpm install
echo we will download other files here later echo we will download other files here later

View File

@@ -1,4 +1,5 @@
common_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Fix for https://www.shellcheck.net/wiki/SC2148
ROOT="$common_DIR/../../" # shellcheck shell=bash
common_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export ROOT="$common_DIR/../../"

View File

@@ -4,12 +4,13 @@
set -eu set -eu
export DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" node_shim_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export node_shim_DIR
source "$DIR/../versions" source "$node_shim_DIR"/../versions
node_bin="$DIR/../../$nodejs_bin_dir/node" source "$node_shim_DIR"/node.common
node_bin="$node_shim_DIR/../../$nodejs_binary_dir/node"
exec "$node_bin" "$@" exec "$node_bin" "$@"

View File

@@ -1,4 +1,7 @@
node_common_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Fix for https://www.shellcheck.net/wiki/SC2148
# shellcheck shell=bash
node_common_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# FIXME this shouldn't be hardcoded here of course # FIXME this shouldn't be hardcoded here of course
nodejs_binary_dir="$node_common_DIR/../binaries/node-v22.15.1-linux-x64/bin" nodejs_binary_dir="$node_common_DIR/../binaries/node-v22.15.1-linux-x64/bin"
@@ -6,7 +9,6 @@ nodejs_binary_dir="$node_common_DIR/../binaries/node-v22.15.1-linux-x64/bin"
# This might be too restrictive. Or not restrictive enough. # This might be too restrictive. Or not restrictive enough.
PATH="$nodejs_binary_dir":/bin:/usr/bin PATH="$nodejs_binary_dir":/bin:/usr/bin
project_root="$node_common_DIR/../.." project_root="$node_common_DIR/../.."
node_dir="$project_root/$nodejs_binary_dir" node_dir="$project_root/$nodejs_binary_dir"

View File

@@ -2,14 +2,12 @@
set -eu set -eu
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" npm_shim_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export npm_shim_DIR
source "$DIR"/node.common # shellcheck source=node.common
source "$npm_shim_DIR"/node.common
cd $DIR/../.nodejs-config cd "$npm_shim_DIR"/../.nodejs-config
echo in dir $(pwd) echo in dir "$(pwd)"
npm "$@" npm "$@"

View File

@@ -2,11 +2,15 @@
set -eu set -eu
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" pnpm_shim_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export pnpm_shim_DIR
source "$DIR"/node.common # shellcheck source=./node.common
source "$DIR"/common source "$pnpm_shim_DIR"/node.common
cd $ROOT/framework/node # shellcheck source=./common
source "$pnpm_shim_DIR"/common
exec "$DIR"/../binaries/pnpm "$@" # cd $ROOT/framework/node
exec "$pnpm_shim_DIR"/../binaries/pnpm "$@"