just a dummy repo for a dummy package

make 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/bash
  2. #shellcheck disable=SC2034
  3. # mkit - simple install helper
  4. # See LICENSE file for copyright and license details.
  5. init_core() {
  6. #
  7. # Load core module (or die)
  8. #
  9. #shellcheck disable=SC1090
  10. . "$MKIT_DIR/include/mkit.sh" \
  11. && . "$MKIT_DIR/include/vars.sh" \
  12. && return 0
  13. echo "failed to load core; check if MKIT_DIR is set properly: $MKIT_DIR" >&2
  14. exit 9
  15. }
  16. #
  17. # Path to MKit dir (where 'include' is)
  18. #
  19. MKIT_DIR=${MKIT_DIR:-$(dirname "$0")}
  20. just_ini() {
  21. #
  22. # Just do one mkit.ini operation $1
  23. #
  24. local op=$1
  25. local key=$2
  26. mkit_init || return $?
  27. ini "$op" "$key"
  28. }
  29. main () {
  30. init_core
  31. case "$1" in
  32. -V|--version-semver) echo "$MKIT_VERSION"; exit 0 ;;
  33. -i|--ini-1value) just_ini 1value "$2"; exit $? ;;
  34. -I|--ini-values) just_ini values "$2"; exit $? ;;
  35. --ini-lskeys) just_ini lskeys "$2"; exit $? ;;
  36. --ini-lssect) just_ini lssect "$2"; exit $? ;;
  37. --ini-sec) just_ini sec "$2"; exit $? ;;
  38. --version) echo "Mkit (Simple Makefile target helper) $MKIT_VERSION"
  39. exit 0 ;;
  40. esac
  41. mkit_init
  42. route "$@"
  43. }
  44. main "$@"