build-host-os.sh 706 B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. #
  3. # Copyright (c) Contributors to the Open 3D Engine Project.
  4. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. #
  6. # SPDX-License-Identifier: Apache-2.0 OR MIT
  7. #
  8. # Query the Host OS from the the os-release file
  9. HOST_OS=$(cat /etc/os-release 2>/dev/null | grep "^NAME" | sed -E -e 's/NAME=(.+)/\1/')
  10. # Remove any surrounding quotes from the OS
  11. HOST_OS=$(sed -E 's/^"(.*)"$/\1/' <<< ${HOST_OS})
  12. if [ "${HOST_OS}" = "Arch Linux" ]; then
  13. bash ./build-archlinux.sh "$@"
  14. elif [ "${HOST_OS}" = "Ubuntu" ]; then
  15. bash ./build-ubuntu.sh "$@"
  16. else
  17. echo "Build script for Host Platform \"${HOST_OS}\" is not available"
  18. exit 1
  19. fi
  20. exit $?