@@ -16,13 +16,18 @@ cd "$(dirname "$0")"
16
16
# http://unix.stackexchange.com/a/84980
17
17
temp_app_path=` mktemp -d 2> /dev/null || mktemp -d -t ' temp_app_path' `
18
18
temp_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`
19
22
20
23
function cleanup {
21
24
echo ' Cleaning up.'
22
25
ps -ef | grep ' react-scripts' | grep -v grep | awk ' {print $2}' | xargs kill -9
23
26
cd " $root_path "
24
27
# TODO: fix "Device or resource busy" and remove ``|| $CI`
25
28
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 "
26
31
}
27
32
28
33
# Error messages are redirected to stderr
@@ -79,11 +84,11 @@ nohup npx verdaccio@2.7.2 &>$tmp_registry_log &
79
84
grep -q ' http address' <( tail -f $tmp_registry_log )
80
85
81
86
# 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 "
84
89
85
90
# Login so we can publish packages
86
- npx npm-cli-login@0.0.10 -u user -p password -e user@example.com -r http://localhost:4873 --quotes
91
+ npx npm-cli-login@0.0.10 -u user -p password -e user@example.com -r " $custom_registry_url " --quotes
87
92
88
93
# Publish the monorepo
89
94
git clean -f
0 commit comments