Browse code

Make mulle-brew behave closer to mulle-bootstrap again

Nat! authored on 01-04-2017 12:34:36
Showing 2 changed files
... ...
@@ -30,7 +30,7 @@
30 30
 #   POSSIBILITY OF SUCH DAMAGE.
31 31
 MULLE_EXECUTABLE_VERSION_MAJOR=3
32 32
 MULLE_EXECUTABLE_VERSION_MINOR=1
33
-MULLE_EXECUTABLE_VERSION_PATCH=1
33
+MULLE_EXECUTABLE_VERSION_PATCH=2
34 34
 
35 35
 MULLE_EXECUTABLE_VERSION="${MULLE_EXECUTABLE_VERSION_MAJOR}.${MULLE_EXECUTABLE_VERSION_MINOR}.${MULLE_EXECUTABLE_VERSION_PATCH}"
36 36
 
... ...
@@ -358,10 +358,8 @@ bootstrap_main()
358 358
       set_build_needed
359 359
    fi
360 360
 
361
-   local previous
362
-
363 361
    case "${command}" in
364
-      -h|--help|config|help|init|uname)
362
+      help|init|uname)
365 363
       ;;
366 364
 
367 365
       *)
... ...
@@ -1,4 +1,4 @@
1
-#! /usr/bin/env bash 
1
+#! /usr/bin/env bash
2 2
 #
3 3
 #   Copyright (c) 2017 Nat! - Mulle kybernetiK
4 4
 #   All rights reserved.
... ...
@@ -30,7 +30,7 @@
30 30
 #   POSSIBILITY OF SUCH DAMAGE.
31 31
 MULLE_EXECUTABLE_VERSION_MAJOR=3
32 32
 MULLE_EXECUTABLE_VERSION_MINOR=1
33
-MULLE_EXECUTABLE_VERSION_PATCH=1
33
+MULLE_EXECUTABLE_VERSION_PATCH=2
34 34
 
35 35
 MULLE_EXECUTABLE_VERSION="${MULLE_EXECUTABLE_VERSION_MAJOR}.${MULLE_EXECUTABLE_VERSION_MINOR}.${MULLE_EXECUTABLE_VERSION_PATCH}"
36 36
 
... ...
@@ -250,37 +250,43 @@ brew_main()
250 250
    command="${1:-install}"
251 251
    [ $# -eq 0 ] || shift
252 252
 
253
-   if [ ! -d "${BOOTSTRAP_DIR}" -a ! -d "${BOOTSTRAP_DIR}.local" ]
254
-   then
255
-      case "$1" in
256
-         -h|--help)
257
-         ;;
258 253
 
259
-         *)
260
-            case "${command}" in
261
-               dist|clean|dist-clean|install|upgrade|update|setup-xcode|xcode)
262
-                  fail "There is no ${BOOTSTRAP_DIR} or ${BOOTSTRAP_DIR}.local folder here ($PWD), can't continue"
263
-               ;;
264
-            esac
265
-         ;;
266
-      esac
267
-   else
268
-      if bootstrap_should_defer_to_master "$@"
269
-      then
270
-         return 1
271
-      fi
254
+   local previous
255
+
256
+   case "${command}" in
257
+      help|init|uname)
258
+      ;;
259
+
260
+      *)
261
+         local  orgpwd
262
+
263
+         orgpwd="$PWD"
264
+
265
+         while ! is_bootstrap_project
266
+         do
267
+            local old
268
+
269
+            old="$PWD"
270
+            cd ..
271
+
272
+            if [ "$PWD" = "${old}" ]
273
+            then
274
+               fail "There is no ${BOOTSTRAP_DIR} or ${BOOTSTRAP_DIR}.local folder here ($orgpwd), can't continue"
275
+            fi
276
+         done
277
+      ;;
278
+   esac
279
+
280
+   if bootstrap_should_defer_to_master "$@"
281
+   then
282
+      return 1
272 283
    fi
273 284
 
285
+
274 286
    MULLE_EXECUTABLE_FAIL_PREFIX="${MULLE_EXECUTABLE} ${command}"
275 287
    MULLE_EXECUTABLE_OPTIONS="$@"
276 288
 
277 289
    case "${command}" in
278
-      build)
279
-         . mulle-bootstrap-build.sh
280
-
281
-         build_main "$@" || exit 1
282
-      ;;
283
-
284 290
       clean)
285 291
          . mulle-bootstrap-clean.sh
286 292
 
... ...
@@ -311,7 +317,7 @@ brew_main()
311 317
          emancipate_main "$@" || exit 1
312 318
       ;;
313 319
 
314
-      flags)
320
+      paths)
315 321
          . mulle-bootstrap-flags.sh
316 322
 
317 323
          flags_main "$@" || exit 1