1 Star 0 Fork 0

karry_ii/blockchain-explorer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.sh 1.37 KB
一键复制 编辑 原始数据 按行查看 历史
nfrunza 提交于 2019-07-09 20:46 . BE-678 Create online documentation
#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
set -e
# Print usage
function print_help() {
echo "Usage: "
echo " main.sh <mode> [-v]"
echo " <mode> - one of 'install', 'test' or 'clean'"
echo " - 'install' - install all dependencies of the project"
echo " - 'test' - run unit tests of the application and client code"
echo " - 'clean' - clean the project directory of installed dependencies"
echo " -v - enable verbose output"
echo " -h - print this message"
}
function do_install() {
VERBOSE=${VERBOSE:+-ddd}
npm install $VERBOSE
(cd app/test && npm install $VERBOSE)
(cd client && npm install $VERBOSE && npm run build)
}
function do_test() {
(cd app/test && npm run test)
(cd client && npm run test:ci -- -u --coverage)
}
function do_clean() {
rm -rf node_modules
rm -rf client/node_modules client/build client/coverage
rm -rf app/test/node_modules
}
# Get subcommand
SUBCOMMAND=$1
shift
case $SUBCOMMAND in
install | test | clean)
;;
*)
print_help
exit 1
;;
esac
OPTIONS="hv"
VERBOSE=
while getopts "$OPTIONS" opt; do
case "$opt" in
v) VERBOSE=true ;;
h)
print_help
exit 1
;;
*)
echo "Unrecognized option: $opt"
exit 2
;;
esac
done
case $SUBCOMMAND in
install)
do_install
;;
test)
do_test
;;
clean)
do_clean
;;
*)
echo "Logic Error"
exit 3
;;
esac
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/karry_ii/blockchain-explorer.git
[email protected]:karry_ii/blockchain-explorer.git
karry_ii
blockchain-explorer
blockchain-explorer
master

搜索帮助