#25 Update sed command to remove old auth token pattern#30
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the host-side token setup script to delete an npm auth token entry using the newer/root //git.1xinternet.de/:_authToken= key, aiming to prevent duplicate/legacy token lines in ~/.npmrc during 1x GitLab token setup.
Changes:
- Adjusted
seddeletion patterns (macOS + Linux) to target//git.1xinternet.de/:_authToken=entries. - Minor diff-only change in a commented line (no functional impact).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # "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 |
There was a problem hiding this comment.
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.
This should match
echo "//git.1xinternet.de/:_authToken=${PERSONAL_ACCESS_TOKEN}" >> ~/.ddev/homeadditions/.npmrc