@@ -16,13 +16,18 @@ cd "$(dirname "$0")"
1616#  http://unix.stackexchange.com/a/84980
1717temp_app_path=` mktemp -d 2> /dev/null ||  mktemp -d -t ' temp_app_path' ` 
1818temp_module_path=` mktemp -d 2> /dev/null ||  mktemp -d -t ' temp_module_path' ` 
19+ custom_registry_url=http://localhost:4873
20+ original_npm_registry_url=` npm get registry` 
21+ original_yarn_registry_url=` yarn config get registry` 
1922
2023function  cleanup  {
2124  echo  ' Cleaning up.' 
2225  ps -ef |  grep ' react-scripts'   |  grep -v grep |  awk ' {print $2}'   |  xargs kill  -9
2326  cd  " $root_path " 
2427  #  TODO: fix "Device or resource busy" and remove ``|| $CI`
2528  rm -rf " $temp_app_path "   " $temp_module_path "   ||  $CI 
29+   npm set  registry " $original_npm_registry_url " 
30+   yarn config set  registry " $original_yarn_registry_url " 
2631}
2732
2833#  Error messages are redirected to stderr
7984grep -q ' http address'   <( tail -f $tmp_registry_log ) 
8085
8186#  Set registry to local registry
82- npm set  registry http://localhost:4873 
83- yarn config set  registry http://localhost:4873 
87+ npm set  registry " $custom_registry_url " 
88+ yarn config set  registry " $custom_registry_url " 
8489
8590#  Login so we can publish packages
86- npx 
[email protected]  -u user -p password -e 
[email protected]  -r 
http://localhost:4873  --quotes
91+ npx 
[email protected]  -u user -p password -e 
[email protected]  -r 
" $custom_registry_url "  --quotes
8792
8893#  Publish the monorepo
8994git clean -f
0 commit comments