diff --git a/Makefile b/Makefile index 51360b5..371b4de 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,6 @@ target: - @echo "Enter target directory:" - @read target; \ - echo $$target > .target + @echo "Select target directory" + @echo $$(find . -name bashly.yml | sed -e 's/.\///' -e 's/\/.*//' | $$DMENU) > .target get-target: $(eval TARGET := $(shell cat .target)) @@ -11,10 +10,17 @@ output-dir: generate: get-target output-dir BASHLY_SOURCE_DIR=$(TARGET) bashly generate - -completions: generate + +generate-upgrade: get-target output-dir + BASHLY_SOURCE_DIR=$(TARGET) bashly generate --upgrade + +completions: generate-upgrade BASHLY_SOURCE_DIR=$(TARGET) bashly add --force completions_script ./output/_$(TARGET) -deploy: completions +docs: generate + BASHLY_SOURCE_DIR=$(TARGET) bashly render :mandoc ./output/man1 + +deploy: completions docs cp -f ./output/$(TARGET) ~/.local/bin/ cp -f ./output/_$(TARGET) ~/.config/completionsrc.d/ + cp -f ./output/man1/$(TARGET)*.1 ~/.local/share/man/man1/ diff --git a/shell.nix b/shell.nix index 121edf5..f0ffc87 100644 --- a/shell.nix +++ b/shell.nix @@ -2,5 +2,6 @@ with import {}; mkShell { nativeBuildInputs = [ bashly + pandoc ]; }