Skip to content

Instantly share code, notes, and snippets.

@surendharreddy
Created August 1, 2020 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save surendharreddy/49ae79fb09df0365bcd0c6d2e6823af7 to your computer and use it in GitHub Desktop.
Save surendharreddy/49ae79fb09df0365bcd0c6d2e6823af7 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -e
set -o pipefail
if [ "$#" -ne 1 ]
then
echo "usage: ./setup_registry.sh GITHUB_PERSONAL_ACCESS_TOKEN"
printf "\n\te.g. ./setup_registry a_token\n"
exit 1
fi
cd ${0%/*}
echo "Setting up registry"
echo "token: $1"
{
echo "//npm.pkg.github.com/:_authToken=$1"
echo "registry=https://registry.yarnpkg.com/"
echo "@<<organisation-name>>:registry=https://npm.pkg.github.com"
echo "always-auth=true"
} > .npmrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment