general_variables_for_meson.sh 675 B

12345678910111213141516171819202122232425
  1. #!/bin/sh
  2. ## For some reasons meson cant read variables from env/files.
  3. ## So we need to a wrapper for variables. This script is a wrapper for importing variables to meson.
  4. ## Note: We use "printf" instead of "echo" because we dont need "\n" at end of outputs. "printf" by default dont print "\n" at end of output.
  5. set -e # Exit immediately if a command exits with a non-zero status.
  6. cd $(dirname $0)
  7. . ./version.conf
  8. case $1 in
  9. version)
  10. printf $VERSION
  11. ;;
  12. month)
  13. printf $MONTH
  14. ;;
  15. year)
  16. printf $YEAR
  17. ;;
  18. *)
  19. echo "Invalid argument. Please set version or month or year as argument"
  20. exit 1
  21. esac