chore(init_tools.sh): adjust init commitizen

This commit is contained in:
John Zhao 2018-12-20 09:27:46 +08:00
parent 827b313378
commit e2d890eaed

View File

@ -226,16 +226,15 @@ fi # _INIT_LINTER_
if [ -n "${_INIT_COMMITIZEN_}" ]; then if [ -n "${_INIT_COMMITIZEN_}" ]; then
if _detect_cmd npm; then if _detect_cmd npm; then
_echo_d "npm install commitizen -g" _echo_d "npm install commitizen -g; npm install"
npm install commitizen -g npm install commitizen -g; npm install
if _detect_cmd node; then # if _detect_cmd node; then
commitizen init cz-conventional-changelog --save-dev --save-exact # commitizen init cz-conventional-changelog --save-dev --save-exact
# npm install --save-dev @commitlint/{config-conventional,cli}
npm install --save-dev @commitlint/{config-conventional,cli} # npm install husky --save-dev
npm install husky --save-dev # else
else # _echo_en "Skipped commitizen init, as node not found"
_echo_en "Skipped commitizen init, as node not found" # fi
fi
else else
_echo_en "Skipped npm install packages, as npm not found" _echo_en "Skipped npm install packages, as npm not found"
_echo _echo
@ -246,6 +245,4 @@ else
_echo_e "p.s. not \"apt-get install npm\", it's too old." _echo_e "p.s. not \"apt-get install npm\", it's too old."
fi fi
# npm install
fi # _INIT_COMMITIZEN_ fi # _INIT_COMMITIZEN_