From 3abee20196f1eae58268b5eebb85d952ebc78200 Mon Sep 17 00:00:00 2001 From: Ilya Kitaev Date: Fri, 23 Sep 2016 00:08:08 +0300 Subject: [PATCH] build: get_platform function reused --- utils.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 utils.sh diff --git a/utils.sh b/utils.sh new file mode 100755 index 00000000..d6132941 --- /dev/null +++ b/utils.sh @@ -0,0 +1,29 @@ +#!/bin/bash + + +function get_platform { + local platform="unknown" + if [ "$(uname)" == "Darwin" ]; then + platform="darwin" + elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then + platform="linux" + elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then + platform="mingw64" + elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then + platform="mingw32" + fi + echo "$platform" + +} + + + + + + + + + + + +