Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ Configuration is primarily handled via `Anchor.toml` and environment variables.

* **`Anchor.toml`**: Specifies program IDs for different clusters (`localnet`, `devnet`), default provider settings (cluster URL, wallet), and script commands.
* **Environment Variables**:
* `SOLANA_CLI_VERSION`: Not directly used, but `bootstrap.sh` and `flake.nix` pin specific versions.
* `SOLANA_CLI_VERSION`: Not directly used, but `flake.nix` pins specific versions.
* `ANCHOR_VERSION`: Managed by `avm` for cross-version compatibility.

## Development
Expand Down
23 changes: 7 additions & 16 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
#!/usr/bin/env bash

#!/usr/bin/env sh
# Copyright 2026 ResQ
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -euo pipefail
exec "$(dirname "$0")/scripts/setup.sh" "$@"
# Canonical onboarding — delegates to resq-software/dev.
# See https://github.com/resq-software/dev for the full installer.
set -eu
export REPO=programs
exec sh -c "$(curl -fsSL https://raw.githubusercontent.com/resq-software/dev/main/install.sh)"
Comment on lines +8 to +9

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The current implementation has two functional issues and a reliability concern:

  1. Environment Variable Override: Hardcoding export REPO=programs prevents users from specifying a different repository name via the environment, which contradicts the test plan mentioned in the PR description (REPO=<name> YES=1 sh bootstrap.sh).
  2. Missing Argument Forwarding: Command-line arguments (e.g., --yes, --skip-keygen) are not passed to the delegated installer. This is a regression from the previous version which used "$@" to support unattended setups.
  3. Error Handling: In many sh implementations (such as dash), set -e does not catch failures in command substitution when used as a direct argument to a command. If curl fails (e.g., due to a 404 or network issue), the script may silently continue and execute an empty string via sh -c.

Consider capturing the installer script into a variable first to ensure the download succeeded before execution, and use a default assignment for REPO to maintain flexibility.

Suggested change
export REPO=programs
exec sh -c "$(curl -fsSL https://raw.githubusercontent.com/resq-software/dev/main/install.sh)"
export REPO="${REPO:-programs}"
INSTALLER=$(curl -fsSL https://raw.githubusercontent.com/resq-software/dev/main/install.sh) || exit 1
exec sh -c "$INSTALLER" sh "$@"

Loading
Loading