#!/usr/bin/env bash # # Download and prepare the 3rd-party libraries # # Author: donkey readonly CUR_DIR=$(cd `dirname $0`; pwd) readonly PROJ_DIR=`dirname $CUR_DIR` function fetch_imgui() { local _REPO="https://github.com/ocornut/imgui" local _TAG=$(git ls-remote --refs -t --sort=-v:refname $_REPO | grep "/v[0-9]\+\.[0-9]\+\.[0-9]\+-docking$" | head -n 1 | cut -f 2 | cut -d "/" -f 3) git clone --branch ${_TAG} --depth 1 $_REPO $PROJ_DIR/3rd-party/imgui } function fetch_node_editor() { local _REPO="https://github.com/thedmd/imgui-node-editor" local _TAG=$(git ls-remote --refs -t --sort=-v:refname $_REPO | grep "/v[0-9]\+\.[0-9]\+\.[0-9]\+$" | head -n 1 | cut -f 2 | cut -d "/" -f 3) git clone --branch ${_TAG} --depth 1 $_REPO $PROJ_DIR/3rd-party/imgui-node-editor } function main() { if [ ! -d "$PROJ_DIR/3rd-party" ]; then mkdir -p "${PROJ_DIR}/3rd-party" fi fetch_imgui fetch_node_editor } main "$@"