forked from nrwl/nx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocal-registry.sh
More file actions
executable file
·32 lines (26 loc) · 883 Bytes
/
local-registry.sh
File metadata and controls
executable file
·32 lines (26 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
COMMAND=$1
if [[ $COMMAND == "enable" ]]; then
echo "Setting registry to local registry"
echo "To Disable: yarn local-registry disable"
npm config set registry http://localhost:4873/ --location user
yarn config set registry http://localhost:4873/
fi
if [[ $COMMAND == "disable" ]]; then
npm config delete registry --location user
yarn config delete registry
CURRENT_NPM_REGISTRY=$(npm config get registry --location user)
CURRENT_YARN_REGISTRY=$(yarn config get registry)
echo "Reverting registries"
echo " > NPM: $CURRENT_NPM_REGISTRY"
echo " > YARN: $CURRENT_YARN_REIGSTRY"
fi
if [[ $COMMAND == "clear" ]]; then
echo "Clearing Local Registry"
rm -rf ./build/local-registry/storage
fi
if [[ $COMMAND == "start" ]]; then
echo "Starting Local Registry"
VERDACCIO_HANDLE_KILL_SIGNALS=true
yarn verdaccio --config ./.verdaccio/config.yml
fi