1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #!/bin/bash
  2. # mkit - simple install helper
  3. # See LICENSE file for copyright and license details.
  4. die() {
  5. echo "$@" && exit 9
  6. }
  7. #
  8. # Debug mode (true|false)
  9. #
  10. MKIT_DEBUG=${MKIT_DEBUG:-false}
  11. #
  12. # Default deploy mode for files
  13. #
  14. MKIT_DEFAULT_MODE="644"
  15. #
  16. # Path to MKit dir (where 'include' is)
  17. #
  18. MKIT_DIR=${MKIT_DIR:-$(dirname "$0")}
  19. #
  20. # Dry mode (true|false)
  21. #
  22. # Set to true to not install anything. Implies MKIT_DEBUG.
  23. #
  24. MKIT_DRY=${MKIT_DRY:-false}
  25. #
  26. # Path to mkit.ini
  27. #
  28. MKIT_INI=${MKIT_INI:-mkit.ini}
  29. #
  30. # Limit ini expansion depth
  31. #
  32. # To avoid endless loops, this value is subtracted each
  33. # time ini() expands a reference; when zero is reached,
  34. # no more expansions happen.
  35. #
  36. MKIT_INI_EXPAND=2
  37. #
  38. # Path to MKit local config and temp
  39. #
  40. # Typically hidden in project root, here MKit can
  41. # save its temporary lists.
  42. #
  43. MKIT_LOCAL=${MKIT_LOCAL:-.mkit}
  44. #
  45. # Package name
  46. #
  47. # Used as base for tarball and in some default tokens.
  48. #
  49. MKIT_PROJ_PKGNAME=""
  50. #
  51. # This MKit version
  52. #
  53. MKIT_VERSION=0.0.14
  54. . "$MKIT_DIR/include/mkit.sh" || die "failed to init; check if MKIT_DIR is set properly: $MKIT_DIR"
  55. case "$1" in
  56. --version-semver) echo "$MKIT_VERSION"; exit 0 ;;
  57. --version) echo "Mkit (Simple Makefile target helper) $MKIT_VERSION"
  58. exit 0 ;;
  59. esac
  60. mkit_init
  61. route "$@"