Skip to content

Commit

Permalink
Resolved unbounded variable issue and Cmake now works properly (#10)
Browse files Browse the repository at this point in the history
* Resolved unbounded variable issue and Cmake now works properly

* Update build.sh

---------

Co-authored-by: Abhishek Rajora <[email protected]>
Co-authored-by: Vicente Eduardo Ferrer Garcia <[email protected]>
  • Loading branch information
3 people authored Apr 13, 2023
1 parent 960382e commit 5185fbf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
set -exuo pipefail

echo "Checking Compiler and Build System"
command -v cmake &>/dev/null && CMAKE_PRESENT=1
command -v curl &>/dev/null && CURL_PRESENT=1
command -v cmake &>/dev/null && CMAKE_PRESENT=1 || CMAKE_PRESENT=0
command -v curl &>/dev/null && CURL_PRESENT=1 || CURL_PRESENT=0

error() {
echo "Error: $1, build stopping, probably dependencies could not be downloaded."
Expand Down Expand Up @@ -49,9 +49,9 @@ download_cmake() {
repo="kitware/cmake"
version="$(get_latest_release $repo)"
download_from_github "$repo" "$version" "cmake-${version#"v"}-macos-universal.dmg" || return 1
echo "Unknown command quitting on purpose" && return 0
MOUNTED_CMAKE_PATH="$(yes | hdiutil attach cmake-${version#"v"}-macos-universal.dmg | tail -n 1 | cut -d$'\t' -f 3)"
export PATH="$MOUNTED_CMAKE_PATH/CMake.app/Contents/bin":"$PATH"
hdiutil detach "$MOUNTED_CMAKE_PATH"
# TODO: CLEANUP see cleanup functions
}

Expand Down Expand Up @@ -221,3 +221,4 @@ post_build() {

# If cmake is present then use it
download_dependencies && extract_deps "$LOC/dependencies/runtime" && install_deps && build_meta && make_metacallcli && post_build && make_tarball && cleanup && exit 0

0 comments on commit 5185fbf

Please sign in to comment.