git-send 0.1.6

Commit and push changes with a single command
BINARY_NAME = git-send
BINARY_PATH = target/release/$(BINARY_NAME)
INSTALL_PATH = /usr/local/bin/$(BINARY_NAME)
SRC_FILES = $(wildcard src/*.rs) Cargo.toml Cargo.lock

.PHONY: all build release clean test lint lint-fix fmt fmt-check check install uninstall run

all: release

release: $(BINARY_PATH)

$(BINARY_PATH): $(SRC_FILES)
	cargo build --release

build:
	cargo build

test:
	cargo test

lint:
	cargo clippy --all-targets --all-features -- -D warnings

lint-fix:
	cargo clippy --fix --allow-dirty --allow-staged

fmt:
	cargo fmt

fmt-check:
	cargo fmt --check

check: fmt-check lint test

run:
	cargo run -- $(ARGS)

clean:
	cargo clean

install: $(INSTALL_PATH)

$(INSTALL_PATH): $(BINARY_PATH)
	sudo install --mode=755 --strip $(BINARY_PATH) $(INSTALL_PATH)

uninstall:
	sudo rm -f $(INSTALL_PATH)