diff --git a/Makefile b/Makefile index f182f0e4b..5e7e6026f 100644 --- a/Makefile +++ b/Makefile @@ -75,12 +75,18 @@ clean: build: mkdir -p build +ifeq ($(OS),Windows_NT) + NIMBLE_DIR ?= $(USERPROFILE)/.nimble +else + NIMBLE_DIR ?= $(HOME)/.nimble +endif +export NIMBLE_DIR + nimble: echo "Inside nimble target, checking for nimble..." && \ - which nimble >/dev/null 2>&1 || { \ + command -v nimble >/dev/null 2>&1 || { \ mv nimbledeps nimbledeps_backup 2>/dev/null || true; \ echo "choosenim not found, installing into $(NIMBLE_DIR)..."; \ - export NIMBLE_DIR="$(NIMBLE_DIR)"; \ curl -sSf https://nim-lang.org/choosenim/init.sh | sh; \ mv nimbledeps_backup nimbledeps 2>/dev/null || true; \ }