Browse code

Fix stupid error, let Makefile check for shellcheck, in case ppl don't bootstrap. Improve output on clean.

Nat! authored on 02-10-2015 22:19:51
Showing 3 changed files
... ...
@@ -16,13 +16,14 @@ SHELLFLAGS=-x -e SC2164,SC2166,SC2006 -s sh
16 16
 
17 17
 .PHONY: all
18 18
 .PHONY: clean
19
+.PHONY: shellcheck_check
19 20
 
20
-%.chk:	%.sh
21
+%.chk:	%.sh shellcheck_check
21 22
 		- ( shellcheck $(SHELLFLAGS) $< || touch $@ )
22 23
 
23 24
 all:	$(CHECKSTAMPS) mulle-bootstrap.chk
24 25
 
25
-mulle-bootstrap.chk:	mulle-bootstrap
26
+mulle-bootstrap.chk:	mulle-bootstrap shellcheck_check
26 27
 		- ( shellcheck $(SHELLFLAGS) $< || touch $@ )
27 28
 
28 29
 install:
... ...
@@ -31,3 +32,6 @@ install:
31 32
 clean:
32 33
 	@- rm *.chk
33 34
 
35
+shellcheck_check:
36
+	which shellcheck || brew install shellcheck
37
+
... ...
@@ -104,9 +104,19 @@ EOF
104 104
 }
105 105
 
106 106
 
107
+check_and_usage_and_help()
108
+{
109
+   cat <<EOF
110
+usage: bootstrap
111
+   There is nothing more to it.
112
+EOF
113
+}
114
+
115
+
107 116
 if [ "$1" = "-h" -o "$1" = "--help" ]
108 117
 then
109
-    check_and_usage_and_help
118
+    check_and_usage_and_help >&2
119
+    exit 1
110 120
 fi
111 121
 
112 122
 command=${1:-"bootstrap"}
... ...
@@ -114,13 +124,6 @@ shift
114 124
 
115 125
 . mulle-bootstrap-warn-scripts.sh
116 126
 
117
-check_and_usage_and_help()
118
-{
119
-   cat <<EOF
120
-usage: bootstrap
121
-   There is nothing more to it.
122
-EOF
123
-}
124 127
 
125 128
 
126 129
 bootstrap()
... ...
@@ -91,7 +91,8 @@ clean_parent_folders_if_empty()
91 91
          if dir_can_be_rmdir "${parent}"
92 92
          then
93 93
             assert_sane_subdir_path "${parent}"
94
-            log_info "Deleting \"${parent}\""
94
+            log_info "Deleting \"${parent}\" because it was empty. "
95
+            log_fluff "Set \".bootstrap/config/clean_empty_parent_folders\" to NO if you don't like it."
95 96
             exekutor rmdir "${parent}"
96 97
          fi
97 98
       done