kn-cli 1.0.56 → 1.0.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -1
- package/templates/template_oa/.DS_Store +0 -0
- package/templates/template_oa/build.sh +2 -0
- package/templates/template_oa/cli.config.js +24 -0
- package/templates/template_oa/dev.sh +89 -0
- package/templates/template_oa/frontend_build.sh +83 -0
- package/templates/template_oa/init/prepare-commit-msg +5 -0
- package/templates/template_oa/init.sh +33 -0
- package/templates/template_oa/jsconfig.json +10 -0
- package/templates/template_oa/package-lock.json +1925 -0
- package/templates/template_oa/package.json +24 -0
- package/templates/template_oa/public/.DS_Store +0 -0
- package/templates/template_oa/public/404.html +26 -0
- package/templates/template_oa/public/favicon.ico +0 -0
- package/templates/template_oa/public/favicon.png +0 -0
- package/templates/template_oa/public/index.html +43 -0
- package/templates/template_oa/public/pluginjs/.DS_Store +0 -0
- package/templates/template_oa/public/src/.DS_Store +0 -0
- package/templates/template_oa/public/src/_antd.less +237 -0
- package/templates/template_oa/public/src/_reset.less +131 -0
- package/templates/template_oa/public/src/_variable.less +84 -0
- package/templates/template_oa/public/src/assets/.DS_Store +0 -0
- package/templates/template_oa/public/src/assets/iconfont/.DS_Store +0 -0
- package/templates/template_oa/public/src/assets/iconfont/iconfont.eot +0 -0
- package/templates/template_oa/public/src/assets/iconfont/iconfont.less +57 -0
- package/templates/template_oa/public/src/assets/iconfont/iconfont.svg +36 -0
- package/templates/template_oa/public/src/assets/iconfont/iconfont.ttf +0 -0
- package/templates/template_oa/public/src/assets/iconfont/iconfont.woff +0 -0
- package/templates/template_oa/public/src/assets/iconfont/iconfont.woff2 +0 -0
- package/templates/template_oa/public/src/assets/images/.DS_Store +0 -0
- package/templates/template_oa/public/src/assets/images/avatar.png +0 -0
- package/templates/template_oa/public/src/assets/images/loading.svg +40 -0
- package/templates/template_oa/public/src/components/.DS_Store +0 -0
- package/templates/template_oa/public/src/components/Alert/index.jsx +0 -0
- package/templates/template_oa/public/src/components/Alert/index.less +0 -0
- package/templates/template_oa/public/src/components/Auth/index.jsx +44 -0
- package/templates/template_oa/public/src/components/Footer/index.jsx +17 -0
- package/templates/template_oa/public/src/components/Footer/index.less +28 -0
- package/templates/template_oa/public/src/components/IFrame/index.jsx +37 -0
- package/templates/template_oa/public/src/components/IFrame/index.less +4 -0
- package/templates/template_oa/public/src/components/IconFont/index.jsx +10 -0
- package/templates/template_oa/public/src/components/IconFont/index.less +5 -0
- package/templates/template_oa/public/src/components/Layout/.DS_Store +0 -0
- package/templates/template_oa/public/src/components/Layout/Basic/index.jsx +31 -0
- package/templates/template_oa/public/src/components/Layout/Basic/index.less +74 -0
- package/templates/template_oa/public/src/components/Layout/CenterBody/index.jsx +15 -0
- package/templates/template_oa/public/src/components/Layout/CenterBody/index.less +36 -0
- package/templates/template_oa/public/src/components/Layout/FormBlock/index.jsx +23 -0
- package/templates/template_oa/public/src/components/Layout/FormBlock/index.less +34 -0
- package/templates/template_oa/public/src/components/Layout/Provider/index.jsx +12 -0
- package/templates/template_oa/public/src/components/Layout/index.jsx +26 -0
- package/templates/template_oa/public/src/components/Layout/index.less +8 -0
- package/templates/template_oa/public/src/components/Link/index.jsx +24 -0
- package/templates/template_oa/public/src/components/Link/index.less +11 -0
- package/templates/template_oa/public/src/components/Loading/index.jsx +14 -0
- package/templates/template_oa/public/src/components/Loading/index.less +85 -0
- package/templates/template_oa/public/src/components/Nav/index.jsx +121 -0
- package/templates/template_oa/public/src/components/Nav/index.less +38 -0
- package/templates/template_oa/public/src/components/Page/.DS_Store +0 -0
- package/templates/template_oa/public/src/components/Page/PageLoading/index.jsx +30 -0
- package/templates/template_oa/public/src/components/Page/PageLoading/index.less +29 -0
- package/templates/template_oa/public/src/components/Popup/index.jsx +22 -0
- package/templates/template_oa/public/src/components/Popup/index.less +18 -0
- package/templates/template_oa/public/src/components/Toast/index.jsx +60 -0
- package/templates/template_oa/public/src/components/Toast/index.less +43 -0
- package/templates/template_oa/public/src/components/mask/index.jsx +47 -0
- package/templates/template_oa/public/src/components/mask/index.less +32 -0
- package/templates/template_oa/public/src/dictionary/index.js +39 -0
- package/templates/template_oa/public/src/hooks/.DS_Store +0 -0
- package/templates/template_oa/public/src/hooks/index.jsx +20 -0
- package/templates/template_oa/public/src/hooks/useDelay.jsx +29 -0
- package/templates/template_oa/public/src/hooks/useImageLoader.jsx +27 -0
- package/templates/template_oa/public/src/hooks/useLoading.jsx +42 -0
- package/templates/template_oa/public/src/hooks/useLogin.jsx +33 -0
- package/templates/template_oa/public/src/hooks/usePreload.jsx +66 -0
- package/templates/template_oa/public/src/hooks/useScrollTop.jsx +32 -0
- package/templates/template_oa/public/src/hooks/useSearch.jsx +137 -0
- package/templates/template_oa/public/src/hooks/useUpdate.jsx +11 -0
- package/templates/template_oa/public/src/index.jsx +50 -0
- package/templates/template_oa/public/src/mock/auth.js +91 -0
- package/templates/template_oa/public/src/mock/index.js +63 -0
- package/templates/template_oa/public/src/mock/user.js +70 -0
- package/templates/template_oa/public/src/mock/utils.js +33 -0
- package/templates/template_oa/public/src/pages/.DS_Store +0 -0
- package/templates/template_oa/public/src/pages/components/pageTitle/index.jsx +13 -0
- package/templates/template_oa/public/src/pages/components/pageTitle/index.less +20 -0
- package/templates/template_oa/public/src/pages/login/index.jsx +27 -0
- package/templates/template_oa/public/src/pages/login/index.less +44 -0
- package/templates/template_oa/public/src/pages/video/index.jsx +91 -0
- package/templates/template_oa/public/src/pages/video/index.less +12 -0
- package/templates/template_oa/public/src/provider/app.jsx +119 -0
- package/templates/template_oa/public/src/provider/menu.jsx +20 -0
- package/templates/template_oa/public/src/route.jsx +43 -0
- package/templates/template_oa/public/src/services/.DS_Store +0 -0
- package/templates/template_oa/public/src/services/auth.js +121 -0
- package/templates/template_oa/public/src/services/index.js +181 -0
- package/templates/template_oa/public/src/services/user.js +26 -0
- package/templates/template_oa/public/src/services/video.js +33 -0
- package/templates/template_oa/public/src/utils/.DS_Store +0 -0
- package/templates/template_oa/public/src/utils/index.js +66 -0
- package/templates/template_oa/public/static/.DS_Store +0 -0
- package/templates/template_oa/public/static/about.html +1 -0
- package/templates/template_oa/public/static/kssoLogin.html +22 -0
- package/templates/template_oa/readme.md +60 -0
- package/templates/template_oa/release/.DS_Store +0 -0
- package/templates/template_oa/report.sh +68 -0
- package/templates/template_oa/tools/.DS_Store +0 -0
- package/templates/template_oa/tools/iconfont/.DS_Store +0 -0
- package/templates/template_oa/tools/iconfont/dist/.DS_Store +0 -0
- package/templates/template_oa/tools/iconfont/gulpfile.js +70 -0
- package/templates/template_oa/tools/iconfont/package.json +20 -0
- package/templates/template_oa/tools/iconfont/run.sh +39 -0
- package/templates/template_oa/tools/iconfont/svg/.DS_Store +0 -0
- package/templates/template_oa/tools/iconfont/svg/arrowBack.svg +1 -0
- package/templates/template_oa/tools/iconfont/svg/check.svg +1 -0
- package/templates/template_oa/tools/iconfont/svg/close.svg +1 -0
- package/templates/template_oa/tools/iconfont/svg/down.svg +1 -0
- package/templates/template_oa/tools/iconfont/svg/image.svg +1 -0
- package/templates/template_oa/tools/iconfont/svg/play.svg +1 -0
- package/templates/template_oa/tools/iconfont/svg/refresh.svg +1 -0
- package/templates/template_oa/tools/iconfont/svg/warn.svg +1 -0
- package/templates/template_oa/tools/iconfont/templates/_icons.css +26 -0
- package/templates/template_oa/tools/iconfont/templates/_icons.less +29 -0
- package/templates/template_oa/tools/iconfont/templates/index.html +56 -0
- package/templates/template_oa/tools/tinypng/.DS_Store +0 -0
- package/templates/template_oa/tools/tinypng/img/.DS_Store +0 -0
- package/templates/template_oa/tools/tinypng/package.json +11 -0
- package/templates/template_oa/tools/tinypng/run.sh +15 -0
- package/templates/template_oa/versionPublish.sh +27 -0
- package/templates/template_oa/webpack.api.js +62 -0
- package/templates/template_offcial/.gitignore +6 -0
- package/templates/template_offcial/build.sh +2 -0
- package/templates/template_offcial/cli.config.js +25 -0
- package/templates/template_offcial/dev.sh +89 -0
- package/templates/template_offcial/frontend_build.sh +83 -0
- package/templates/template_offcial/init/prepare-commit-msg +5 -0
- package/templates/template_offcial/init.sh +33 -0
- package/templates/template_offcial/jsconfig.json +10 -0
- package/templates/template_offcial/package.json +23 -0
- package/templates/template_offcial/public/404.html +26 -0
- package/templates/template_offcial/public/favicon.ico +0 -0
- package/templates/template_offcial/public/favicon.png +0 -0
- package/templates/template_offcial/public/index.html +52 -0
- package/templates/template_offcial/public/src/_antd.less +4 -0
- package/templates/template_offcial/public/src/_reset.less +130 -0
- package/templates/template_offcial/public/src/_variable.less +78 -0
- package/templates/template_offcial/public/src/assets/iconfont/iconfont.eot +0 -0
- package/templates/template_offcial/public/src/assets/iconfont/iconfont.less +57 -0
- package/templates/template_offcial/public/src/assets/iconfont/iconfont.svg +36 -0
- package/templates/template_offcial/public/src/assets/iconfont/iconfont.ttf +0 -0
- package/templates/template_offcial/public/src/assets/iconfont/iconfont.woff +0 -0
- package/templates/template_offcial/public/src/assets/iconfont/iconfont.woff2 +0 -0
- package/templates/template_offcial/public/src/assets/images/avatar.png +0 -0
- package/templates/template_offcial/public/src/assets/images/loading.svg +40 -0
- package/templates/template_offcial/public/src/components/Alert/index.jsx +0 -0
- package/templates/template_offcial/public/src/components/Alert/index.less +0 -0
- package/templates/template_offcial/public/src/components/Footer/index.jsx +32 -0
- package/templates/template_offcial/public/src/components/Footer/index.less +8 -0
- package/templates/template_offcial/public/src/components/Header/index.jsx +68 -0
- package/templates/template_offcial/public/src/components/Header/index.less +76 -0
- package/templates/template_offcial/public/src/components/IconFont/index.jsx +10 -0
- package/templates/template_offcial/public/src/components/IconFont/index.less +5 -0
- package/templates/template_offcial/public/src/components/Layout/Provider/index.jsx +12 -0
- package/templates/template_offcial/public/src/components/Layout/index.jsx +20 -0
- package/templates/template_offcial/public/src/components/Layout/index.less +20 -0
- package/templates/template_offcial/public/src/components/Link/index.jsx +24 -0
- package/templates/template_offcial/public/src/components/Link/index.less +11 -0
- package/templates/template_offcial/public/src/components/Page/PageLoading/index.jsx +30 -0
- package/templates/template_offcial/public/src/components/Page/PageLoading/index.less +29 -0
- package/templates/template_offcial/public/src/components/Popup/index.jsx +22 -0
- package/templates/template_offcial/public/src/components/Popup/index.less +18 -0
- package/templates/template_offcial/public/src/components/Toast/index.jsx +60 -0
- package/templates/template_offcial/public/src/components/Toast/index.less +43 -0
- package/templates/template_offcial/public/src/hooks/index.jsx +12 -0
- package/templates/template_offcial/public/src/hooks/useImageLoader.jsx +27 -0
- package/templates/template_offcial/public/src/hooks/useInToView.jsx +55 -0
- package/templates/template_offcial/public/src/hooks/usePreload.jsx +66 -0
- package/templates/template_offcial/public/src/hooks/useScroll.jsx +66 -0
- package/templates/template_offcial/public/src/index.jsx +50 -0
- package/templates/template_offcial/public/src/mock/index.js +63 -0
- package/templates/template_offcial/public/src/mock/user.js +70 -0
- package/templates/template_offcial/public/src/mock/utils.js +33 -0
- package/templates/template_offcial/public/src/pages/index.jsx +23 -0
- package/templates/template_offcial/public/src/pages/index.less +0 -0
- package/templates/template_offcial/public/src/pages/mobile/index.jsx +11 -0
- package/templates/template_offcial/public/src/pages/mobile/index.less +0 -0
- package/templates/template_offcial/public/src/pages/pc/index.jsx +45 -0
- package/templates/template_offcial/public/src/pages/pc/index.less +42 -0
- package/templates/template_offcial/public/src/provider/app.jsx +26 -0
- package/templates/template_offcial/public/src/route.jsx +26 -0
- package/templates/template_offcial/public/src/services/index.js +182 -0
- package/templates/template_offcial/public/src/services/user.js +26 -0
- package/templates/template_offcial/public/src/utils/index.js +109 -0
- package/templates/template_offcial/public/static/about.html +1 -0
- package/templates/template_offcial/readme.md +59 -0
- package/templates/template_offcial/report.sh +68 -0
- package/templates/template_offcial/tools/iconfont/gulpfile.js +70 -0
- package/templates/template_offcial/tools/iconfont/package.json +20 -0
- package/templates/template_offcial/tools/iconfont/run.sh +39 -0
- package/templates/template_offcial/tools/iconfont/svg/arrowBack.svg +1 -0
- package/templates/template_offcial/tools/iconfont/svg/check.svg +1 -0
- package/templates/template_offcial/tools/iconfont/svg/close.svg +1 -0
- package/templates/template_offcial/tools/iconfont/svg/down.svg +1 -0
- package/templates/template_offcial/tools/iconfont/svg/image.svg +1 -0
- package/templates/template_offcial/tools/iconfont/svg/play.svg +1 -0
- package/templates/template_offcial/tools/iconfont/svg/refresh.svg +1 -0
- package/templates/template_offcial/tools/iconfont/svg/warn.svg +1 -0
- package/templates/template_offcial/tools/iconfont/templates/_icons.css +26 -0
- package/templates/template_offcial/tools/iconfont/templates/_icons.less +29 -0
- package/templates/template_offcial/tools/iconfont/templates/index.html +56 -0
- package/templates/template_offcial/tools/tinypng/package.json +11 -0
- package/templates/template_offcial/tools/tinypng/run.sh +15 -0
- package/templates/template_offcial/versionPublish.sh +27 -0
- package/templates/template_offcial/webpack.api.js +36 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kn-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.57",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
"src/",
|
|
12
12
|
"templates/template_app/",
|
|
13
13
|
"templates/template_admin/",
|
|
14
|
+
"templates/template_oa/",
|
|
15
|
+
"templates/template_offcial/",
|
|
14
16
|
"build"
|
|
15
17
|
],
|
|
16
18
|
"bin": {
|
|
Binary file
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
module.exports = {
|
|
3
|
+
name:'template-oa',
|
|
4
|
+
registryType:'npm',//npm镜像源,taobao|npm
|
|
5
|
+
less:{
|
|
6
|
+
javascriptEnabled:true,//是否开启less js
|
|
7
|
+
},
|
|
8
|
+
rules:{
|
|
9
|
+
compileNpmPackage:['kn-hooks'],//需要参与编译的npm包
|
|
10
|
+
},
|
|
11
|
+
cssModule: (resourcePath) => {
|
|
12
|
+
console.log(resourcePath)
|
|
13
|
+
// antd.less编译的时候使用global模式
|
|
14
|
+
if (/antd.less$/i.test(resourcePath)) {
|
|
15
|
+
return 'global'
|
|
16
|
+
}
|
|
17
|
+
return "local";
|
|
18
|
+
},
|
|
19
|
+
// 自定义多入口
|
|
20
|
+
// entry:{
|
|
21
|
+
// 'home/index': 'src/jsx/home/index.jsx',
|
|
22
|
+
// },
|
|
23
|
+
// copyFolder:['images','plugins'],//完整复制的文件夹
|
|
24
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
if [ -d "${HOME}/.nvm/" ]
|
|
2
|
+
then
|
|
3
|
+
. ${HOME}/.nvm/nvm.sh
|
|
4
|
+
fi
|
|
5
|
+
|
|
6
|
+
node_version="v16.18.0"
|
|
7
|
+
|
|
8
|
+
checkNode(){
|
|
9
|
+
for line in `node -v`
|
|
10
|
+
do
|
|
11
|
+
if [ $line != $node_version ]
|
|
12
|
+
then
|
|
13
|
+
echo "change Node from $line to $node_version"
|
|
14
|
+
nvm use $node_version
|
|
15
|
+
ret=$?
|
|
16
|
+
if [ $ret != 0 ]
|
|
17
|
+
then
|
|
18
|
+
echo "Please run nvm install $node_version"
|
|
19
|
+
exit 3
|
|
20
|
+
else
|
|
21
|
+
return 0
|
|
22
|
+
fi
|
|
23
|
+
else
|
|
24
|
+
return 0
|
|
25
|
+
fi
|
|
26
|
+
done
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
checkResult(){
|
|
30
|
+
ret=$?
|
|
31
|
+
if [ $ret != 0 ]
|
|
32
|
+
then
|
|
33
|
+
echo "[$1]执行失败"
|
|
34
|
+
exit 2
|
|
35
|
+
return 0
|
|
36
|
+
else
|
|
37
|
+
echo "[$1]执行成功"
|
|
38
|
+
return 0
|
|
39
|
+
fi
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
# 智能检测并安装/升级CLI的版本
|
|
46
|
+
checkKnCli(){
|
|
47
|
+
# dev只需要保持安装了就行,版本通过开发自己控制
|
|
48
|
+
if ! [ -x "$(command -v kn-cli)" ]
|
|
49
|
+
then
|
|
50
|
+
echo "安装kn-cli"
|
|
51
|
+
npm i kn-cli -g
|
|
52
|
+
return 0
|
|
53
|
+
fi
|
|
54
|
+
# for line in `npm view kn-cli version`
|
|
55
|
+
# do
|
|
56
|
+
# for line2 in `kn-cli -v`
|
|
57
|
+
# do
|
|
58
|
+
# if [ $line != $line2 ]
|
|
59
|
+
# then
|
|
60
|
+
# echo "升级kn-cli"
|
|
61
|
+
# npm upgrade kn-cli -g
|
|
62
|
+
# return 0
|
|
63
|
+
# fi
|
|
64
|
+
# done
|
|
65
|
+
# done
|
|
66
|
+
# return 0
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
build(){
|
|
72
|
+
npm config delete registry -g
|
|
73
|
+
npm config delete registry
|
|
74
|
+
|
|
75
|
+
checkKnCli
|
|
76
|
+
checkResult "检查kn-cli"
|
|
77
|
+
# dev_mode=watch 代表使用 webpack -w模式将文件编译后生成到磁盘上进行监听更新
|
|
78
|
+
# 默认情况下为 webpack-dev-server模式,将资源编译后放入内存监听
|
|
79
|
+
# export dev_mode=watch
|
|
80
|
+
|
|
81
|
+
kn-cli --dev
|
|
82
|
+
checkResult "kn-cli --dev"
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
checkNode
|
|
86
|
+
checkResult "检查node"
|
|
87
|
+
|
|
88
|
+
build
|
|
89
|
+
checkResult "build"
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
if [ -d "${HOME}/.nvm/" ]
|
|
2
|
+
then
|
|
3
|
+
. ${HOME}/.nvm/nvm.sh
|
|
4
|
+
fi
|
|
5
|
+
|
|
6
|
+
export mock=0
|
|
7
|
+
export oSkipNpmInstall=1
|
|
8
|
+
node_version="v16.18.0"
|
|
9
|
+
|
|
10
|
+
checkNode(){
|
|
11
|
+
for line in `node -v`
|
|
12
|
+
do
|
|
13
|
+
if [ $line != $node_version ]
|
|
14
|
+
then
|
|
15
|
+
echo "change Node from $line to $node_version"
|
|
16
|
+
nvm use $node_version
|
|
17
|
+
ret=$?
|
|
18
|
+
if [ $ret != 0 ]
|
|
19
|
+
then
|
|
20
|
+
echo "Please run nvm install $node_version"
|
|
21
|
+
exit 3
|
|
22
|
+
else
|
|
23
|
+
return 0
|
|
24
|
+
fi
|
|
25
|
+
else
|
|
26
|
+
return 0
|
|
27
|
+
fi
|
|
28
|
+
done
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
checkKnCli(){
|
|
33
|
+
if ! [ -x "$(command -v kn-cli)" ]
|
|
34
|
+
then
|
|
35
|
+
npm i kn-cli -g
|
|
36
|
+
return 0
|
|
37
|
+
fi
|
|
38
|
+
return 0
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
checkResult(){
|
|
43
|
+
ret=$?
|
|
44
|
+
if [ $ret != 0 ]
|
|
45
|
+
then
|
|
46
|
+
echo "[$1]执行失败"
|
|
47
|
+
exit 2
|
|
48
|
+
return 0
|
|
49
|
+
else
|
|
50
|
+
echo "[$1]执行成功"
|
|
51
|
+
return 0
|
|
52
|
+
fi
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
build(){
|
|
56
|
+
npm config delete registry -g
|
|
57
|
+
npm config delete registry
|
|
58
|
+
|
|
59
|
+
rm -rf release
|
|
60
|
+
checkResult "清理release"
|
|
61
|
+
|
|
62
|
+
checkKnCli
|
|
63
|
+
checkResult "检查kn-cli"
|
|
64
|
+
|
|
65
|
+
# npm i kn-cli@1.0.2 -g
|
|
66
|
+
# checkResult "npm kn-cli"
|
|
67
|
+
|
|
68
|
+
kn-cli --build
|
|
69
|
+
checkResult "kn-cli --build"
|
|
70
|
+
|
|
71
|
+
mv public/dist release/
|
|
72
|
+
checkResult "打包结果同步至release"
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
checkNode
|
|
76
|
+
checkResult "检查node"
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
build
|
|
80
|
+
checkResult "build"
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
checkResult(){
|
|
2
|
+
ret=$?
|
|
3
|
+
if [ $ret != 0 ]
|
|
4
|
+
then
|
|
5
|
+
echo "[$1]执行失败"
|
|
6
|
+
exit 2
|
|
7
|
+
return 0
|
|
8
|
+
else
|
|
9
|
+
echo "[$1]执行成功"
|
|
10
|
+
return 0
|
|
11
|
+
fi
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
echo "安装git提交钩子脚本 cp prepare-commit-msg ./.git/hooks/prepare-commit-msg"
|
|
15
|
+
ls -A ./.git/
|
|
16
|
+
ret=$?
|
|
17
|
+
if [ $ret != 0 ]
|
|
18
|
+
then
|
|
19
|
+
echo "缺少.git文件夹"
|
|
20
|
+
exit 2
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
ls -A ./.git/hooks/
|
|
24
|
+
ret=$?
|
|
25
|
+
if [ $ret != 0 ]
|
|
26
|
+
then
|
|
27
|
+
mkdir ./.git/hooks
|
|
28
|
+
checkResult '创建hooks文件夹'
|
|
29
|
+
fi
|
|
30
|
+
cp ./init/prepare-commit-msg ./.git/hooks/prepare-commit-msg
|
|
31
|
+
checkResult '复制prepare-commit-msg'
|
|
32
|
+
chmod u+x ./.git/hooks/prepare-commit-msg
|
|
33
|
+
checkResult '权限变更prepare-commit-msg'
|