diff --git a/Makefile b/Makefile index 770ab97..e61f6a5 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,17 @@ -default: - go build -ldflags "-X main.GitCommit=$$(git rev-list -1 HEAD) -X main.Version=$$(git describe --tags) -X main.Date=$$(date --rfc-3339=date)" +DATE := $$(date +%Y-%m-%dT%T%z) +VERSION := $$(git describe --tags) +COMMIT := $$(git rev-list -1 HEAD) +DST ?= ~/.bin/ -copy: - go build -ldflags "-X main.GitCommit=$$(git rev-list -1 HEAD) -X main.Version=$$(git describe --tags) -X main.Date=$$(date --rfc-3339=date)" && cp ./terraform-lsp ~/.bin/ && cp ./terraform-lsp ~/ +terraform-lsp: + go build -ldflags "-X main.GitCommit=$(COMMIT) -X main.Version=$(VERSION) -X main.Date=$(DATE)" -.PHONY: copy +copy: terraform-lsp + cp ./terraform-lsp $(DST) && cp ./terraform-lsp ~/ + +clean: + rm -f terraform-lsp + +default: terraform-lsp + +.PHONY: clean copy diff --git a/README.md b/README.md index 83085ff..eb0aa92 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ This is LSP (Language Server Protocol) for Terraform **IMPORTANT:** Currently there is two terraform lsp, one is this one and the other one is [terraform-ls](https://github.com/hashicorp/terraform-ls), which contain details about this repo as well. -The aim to have a unified lsp for terraform in the future, but for now there is two concurrent development with collabration to each other, this repo is aim for more experimental features, and the terraform-ls is aim for stableness +The aim to have a unified lsp for terraform in the future, but for now there is two concurrent development with collabration to each other, this repo is aim for more experimental features, and the terraform-ls is aim for stableness **NOTE:** This is first stage of the plugin, so is experimental @@ -48,6 +48,12 @@ make # Build the project. Alternatively run "go build" make copy # Install the project ``` +you may also specify a path to your preferred bin directory with the `DST` parameter + +```sh +make copy DST="$your_preferred_bin_path" # Install the project +``` + ### Nixpkgs - install nixpkgs @@ -101,7 +107,7 @@ All Todos are listed [here](Todo.md) ## Bugs - Order of completion items -- Issue with block +- Issue with block ## Credits - LSP structure using [Sourcegraph's go-lsp](https://github.com/sourcegraph/go-lsp)