File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33source ./utils.sh
44
55LEFTHOOK_VERSION=${VERSION:- " latest" }
6- INSTALL_DIRECTLY_FROM_GITHUB_RELEASE=${INSTALLDIRECTLYFROMGITHUBRELEASE:- " false " }
6+ INSTALL_DIRECTLY_FROM_GITHUB_RELEASE=${INSTALLDIRECTLYFROMGITHUBRELEASE:- " true " }
77GITHUB_REPO=https://github.com/evilmartians/lefthook
88
99# Exit immediately if a command exits with a non-zero status.
@@ -80,14 +80,16 @@ install_from_package_manager() {
8080 apt-get install -y --no-install-recommends lefthook=${latest_version}
8181}
8282
83- # Install curl, ca-certificates, git if missing
83+ # Install curl if missing
8484check_packages curl ca-certificates
85- if ! type git > /dev/null 2>&1 ; then
86- check_packages git
87- fi
8885
8986# Install Lefthook
9087if [ " ${INSTALL_DIRECTLY_FROM_GITHUB_RELEASE} " = " true" ]; then
88+ # Install git if missing
89+ if ! type git > /dev/null 2>&1 ; then
90+ check_packages git
91+ fi
92+
9193 install_from_github
9294else
9395 install_from_package_manager
Original file line number Diff line number Diff line change @@ -10,7 +10,8 @@ apt_get_update() {
1010check_packages () {
1111 if ! dpkg -s " $@ " > /dev/null 2>&1 ; then
1212 apt_get_update
13- apt-get -y --no-install-recommends " $@ "
13+ echo " Installing $@ ..."
14+ apt-get install -y --no-install-recommends $@
1415 fi
1516}
1617
You can’t perform that action at this time.
0 commit comments