forked from TuneZilla-Development/verdaccio-oidc-ui
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun
executable file
·97 lines (82 loc) · 1.68 KB
/
run
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/usr/bin/env bash
set -e
#
# Helpers
##################################################
red="\e[31m"
reset="\e[39m"
run() {
task=${1}
shift
echo -e [${task}] ${@}
${@}
}
fail() {
echo -e ${red}${@}${reset}
exit 1
}
#
# Commands
##################################################
linkdir=node_modules/verdaccio-github-oauth-ui
#
# Build server, config and client
#
build() {
run build node rollup.js
run build cp -R src/client/*.css dist/public/
}
#
# Remove the plugin from node_modules
#
clean() {
run clean rm -rf dist
run clean rm -rf $linkdir
}
#
# Copy the built plugin to node_modules
#
link() {
run link mkdir -p $linkdir/
run link cp -R dist $linkdir/
run link cp package.json $linkdir/
run link cp verdaccio.yaml $linkdir/
}
#
# Run linters
#
lint() {
yarn tsc -p src/cli/tsconfig.json
yarn tsc -p src/client/tsconfig.json
yarn tsc -p src/server/tsconfig.json
yarn tsc -p test/tsconfig.json
yarn tslint -p src/cli/tsconfig.json ${@}
yarn tslint -p src/client/tsconfig.json ${@}
yarn tslint -p src/server/tsconfig.json ${@}
yarn tslint -p test/tsconfig.json ${@}
}
whoami() {
npm whoami --registry http://localhost:4873
}
#
# Sinopia CLI test
#
oauth-cli-test() {
# npx verdaccio-github-oauth-ui --registry http://localhost:4873
./dist/cli.js --registry http://localhost:4873
whoami
}
#
# CLI
##################################################
#
# Call the function specified by the first parameter, passing all remaining
# parameters to the function. If no such function exists, display usage info.
#
if [ -n "$1" ] && type $1 | grep -i function > /dev/null; then
command="$1"
shift
$command ${@}
else
fail "No such command: $1"
fi