Skip to content

artifacts-helper's install.sh doesn't install shims #108

@abdurriq

Description

@abdurriq

Reported by @netoront.

To reproduce:

  1. Create a repo with
    • A devcontainer.json that uses the feature "ghcr.io/microsoft/codespace-features/artifacts-helper:3"
    • A post-create command that runs write-npm.sh to add an Azure Artifacts feed
    • A JS project that uses NPM
  2. Create a Codespace
  3. Run npm install in the Codespace and get 401 errors
  4. Run type -t npm and see that it's a file rather than a function as expected

The bug was introduced in two steps:

  1. On 2025-12-04, c298b99 removed COMMA_SEP_TARGET_FILES="${TARGETFILES:-"DEFAULT"}" and the logic below it to set the actual default value
  2. On 2025-12-05, e34adf2 restored the logic to set the default value but didn't restore the initialization of COMMA_SEP_TARGET_FILES, so the default value logic gets skipped no matter what

You'll probably find in your testing that the newlines aren't being properly appended between shim function definitions. Easiest fix is to change "...stuff...\n" to "...stuff..."$'\n'.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions