Skip to content

Add add-script feature#260

Merged
sebst merged 2 commits intomainfrom
copilot/add-add-script-feature
Mar 31, 2026
Merged

Add add-script feature#260
sebst merged 2 commits intomainfrom
copilot/add-add-script-feature

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

Companion to run-script that permanently places a script at /usr/local/bin/<name> without executing it during the devcontainer build.

Changes

  • src/add-script/devcontainer-feature.json — three options: name (target filename), url (remote script), script (inline text)
  • src/add-script/install.sh — writes script to /usr/local/bin/<name>, sets chmod 755, never executes it; gracefully no-ops if name/source is absent; errors on url+script conflict
  • src/add-script/NOTES.md — feature documentation
  • test/add-script/test.sh — baseline test
  • README.md — added row in alphabetical order

Usage

"features": {
    "ghcr.io/devcontainer-community/devcontainer-features/add-script:1": {
        "name": "my-setup",
        "script": "#!/bin/bash\napt-get install -y ripgrep"
    }
}

The script is available as my-setup in the container but must be invoked explicitly — it is not run at build time.

Differences from run-script

run-script add-script
Script location temp file, deleted after use /usr/local/bin/<name> (permanent)
Executed during install yes no
Extra option name (required)

Copilot AI linked an issue Mar 31, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add add-script feature with persistent script location Add add-script feature Mar 31, 2026
Copilot AI requested a review from sebst March 31, 2026 08:57
@sebst sebst marked this pull request as ready for review March 31, 2026 09:03
@sebst sebst merged commit 2a79d75 into main Mar 31, 2026
7 checks passed
@sebst sebst deleted the copilot/add-add-script-feature branch March 31, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "add-script" feature

2 participants