Skip to content
Merged
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
6 changes: 3 additions & 3 deletions commands/host/1x-token-setup
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ fi
# Make this work on MacOS and Linux >.<
if [[ $OSTYPE == darwin* ]]; then
# "in-place editing only works for regular files" thus change directly ~/.npmrc
sed -i '' '/\/\/git.1xinternet.de\/api\/v4\/packages\/npm\/:_authToken=/d' ~/.npmrc
sed -i '' '/\/\/git.1xinternet.de\/:_authToken=/d' ~/.npmrc
else
# "In-place editing" works also for symlinks on Linux, but for consistency's sake.
sed -i '/\/\/git.1xinternet.de\/api\/v4\/packages\/npm\/:_authToken=/d' ~/.npmrc
sed -i '/\/\/git.1xinternet.de\/:_authToken=/d' ~/.npmrc
Comment on lines 79 to +83
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

The updated sed pattern only removes the root token entry (//git.1xinternet.de/:_authToken=). If a user still has the previous path-scoped token entry (the /api/v4/.../packages/npm/ key that this script used to delete), it will now be left behind, resulting in multiple GitLab token lines in ~/.npmrc and potentially ambiguous auth behavior. Consider deleting both the old path-scoped pattern and the new root pattern (or using a single regex that matches both) before appending the new token.

Copilot uses AI. Check for mistakes.
fi
echo "//git.1xinternet.de/:_authToken=${PERSONAL_ACCESS_TOKEN}" >> ~/.ddev/homeadditions/.npmrc

Expand Down Expand Up @@ -121,4 +121,4 @@ echo "Setup complete!"
# Persist the new .composer/auth.json and .npmrc from the container back to your host (if desired):
# @todo Be respectful: make sure this is desired and we don't just overwrite stuff on the host.
# ddev exec 'cat $HOME/.composer/auth.json' > ~/.composer/auth.json
# ddev exec 'cat $HOME/.npmrc' > ~/.npmrc
# ddev exec 'cat $HOME/.npmrc' > ~/.npmrc