包含了一系列开发帮助脚本,这些脚本旨在帮助开发者快速设置环境、配置依赖和解决常见问题,无需记忆复杂的命令或手动编辑配置文件。
go install cnb.cool/1024hub/helper-script/helper@latest
然后就能使用 helper 命令来执行各种脚本。
这个脚本可以帮助你快速配置 CNB NPM Registry 的 .npmrc 文件,并配置作用域。以便于下载cnb制品库的包。作用域之外的包,默认使用https://registry.npmmirror.com/作为registry
交互式命令执行:
直接执行
bash -c "$(curl -s https://cnb.cool/1024hub/helper-script/-/git/raw/master/scripts/setup-cnb-npmrc.sh)"
非交互式命令执行:
bash <(curl -s https://cnb.cool/1024hub/helper-script/-/git/raw/master/scripts/setup-cnb-npmrc.sh) -t "{your_token}" -p "{your_artifactory_path} -s {your_scope}"
.npmrc 文件应与你的 package.json 文件位于同一目录.npmrc 文件,该脚本会覆盖它,请提前备份生成的 .npmrc 文件内容类似于:
; CNB NPM Registry 配置 @your-scope:registry=https://npm.cnb.cool/org/artifactory/-/packages/ always-auth=true //npm.cnb.cool/org/artifactory/-/packages/:username=cnb //npm.cnb.cool/org/artifactory/-/packages/:_authToken=your-token
bash <(curl -s https://cnb.cool/1024hub/helper-script/-/git/raw/master/scripts/editorconfig-downloader.sh)
export CNB_TOKEN={your_cnb_token}
export CNB_ARTIFACTORY_PATH={default_cnb_artifactory_path}
export CNB_SCOPE={default_cnb_scope}
alias setup-cnb-npmrc="bash <(curl -s https://cnb.cool/1024hub/helper-script/-/git/raw/master/scripts/setup-cnb-npmrc.sh)"
alias editorconfig-downloader="bash <(curl -s https://cnb.cool/1024hub/helper-script/-/git/raw/master/scripts/editorconfig-downloader.sh)"