Repository navigation
Expand file tree
/
Copy pathpackage-scripts.sh
More file actions
executable file
·54 lines (49 loc) · 1.9 KB
/
Copy pathpackage-scripts.sh
File metadata and controls
executable file
·54 lines (49 loc) · 1.9 KB
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
#!/bin/zsh
# Check if the 'fzf' command is available in the system
if ! command -v fzf &> /dev/null; then
tput setaf 1;
echo "fzf is not installed. <https://github.com/junegunn/fzf>";
tput sgr0;
exit 1;
fi
local option_list=(
"format-fix: Fixes the code format"
"format-check: Checks the code format"
"lint-fix: Fixes the code lint"
"lint-check: Checks the code lint"
"build: Builds the project"
# "build-esm: Builds the ESModule project"
"minify: Minifies the project"
# "minify-esm: Minifies the ESModule project"
"dev: Starts the development server"
# "test: Runs the tests"
"test-coverage: Runs the tests and generates the coverage report"
# "clean-all: Cleans the project"
# "clean-jest: Cleans the jest cache"
# "clean-coverage: Cleans the coverage report"
# "clean-dist: Cleans the dist directory"
# "clean-cache: Cleans the cache"
"modules-reinstall: Cleans the modules"
# "modules-clean: Cleans the modules"
"pre-publish-only: Pre-publishes the project"
"post-publish: Post-publishes the project"
"reflect-toc: Reflects the TOC"
"typedoc: Generates the typedoc"
"all: Runs all the jobs"
"setup: Setup modules"
)
local selected_option=$(printf "%s\n" "${option_list[@]}" | fzf --ansi --prompt="Select a job to execute > ")
case $selected_option in
"setup")
corepack enable pnpm;
pnpm -v;
pnpm install;
;;
*)
if [[ -n "$selected_option" && "$selected_option" =~ [^[:space:]] ]]; then
command="pnpm $(echo "$selected_option" | cut -d':' -f1)"
eval $command;
fi;
;;
esac
exit 0;