GIT := git
PNPM := pnpm
CARGO := cargo
DOCKER := docker
CD := cd
NEOCRATES_PATH := ./neocrates
define git_push_if_needed
@if [ -n "$$($(GIT) status --porcelain)" ]; then \
$(GIT) add .; \
$(GIT) commit -m "$(m)"; \
$(GIT) push; \
else \
echo "No changes to commit"; \
fi
endef
define git_commit_if_needed
@if [ -n "$$($(GIT) status --porcelain)" ]; then \
$(GIT) add .; \
$(GIT) commit -m "$(m)"; \
else \
echo "No changes to commit"; \
fi
endef
git-run:
$(call git_push_if_needed)
git-commit:
$(call git_commit_if_needed)
build:
@echo "===> Build neocrates"
$(CARGO) build -p neocrates || exit 1
test:
@echo "===> Test neocrates"
$(CARGO) test -p neocrates || exit 1
clean:
@echo "Cleaning neocrate in $(NEOCRATES_PATH)..."
$(CARGO) clean
dry-run:
@echo "===> Dry-run neocrates"
$(call git_commit_if_needed)
$(CARGO) publish -p neocrates --dry-run --registry crates-io || exit 1
publish:
@echo "===> Publishing neocrates"
$(call git_commit_if_needed)
$(CARGO) publish -p neocrates --registry crates-io || exit 1
$(CARGO) clean