forked from nvim-telescope/telescope-file-browser.nvim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (28 loc) · 1023 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
.PHONY: docgen test clean
DEPS_DIR := deps
TS_DIR := $(DEPS_DIR)/tree-sitter-lua
PLENARY_DIR := $(DEPS_DIR)/plenary.nvim
TELESCOPE_DIR := $(DEPS_DIR)/telescope.nvim
define git_clone_or_pull
@mkdir -p $(dir $1)
@if [ ! -d "$1" ]; then \
git clone --depth 1 $2 $1; \
else \
git -C "$1" pull; \
fi
endef
$(DEPS_DIR):
@mkdir -p $@
plenary: | $(DEPS_DIR)
$(call git_clone_or_pull,$(PLENARY_DIR),https://github.com/nvim-lua/plenary.nvim)
docgen-deps: plenary | $(DEPS_DIR)
$(call git_clone_or_pull,$(TS_DIR),https://github.com/tjdevries/tree-sitter-lua)
cd "$(TS_DIR)" && make dist
test-deps: plenary | $(DEPS_DIR)
$(call git_clone_or_pull,$(TELESCOPE_DIR),https://github.com/nvim-telescope/telescope.nvim)
docgen: docgen-deps
nvim --headless --noplugin -u scripts/minimal_init.vim -c "luafile ./scripts/gendocs.lua" -c 'qa'
test: test-deps
nvim --headless --noplugin -u scripts/minimal_init.vim -c "PlenaryBustedDirectory lua/tests/ { minimal_init = './scripts/minimal_init.vim' }"
clean:
@rm -rf $(DEPS_DIR)