From 99d438df6b0e6bf55e6f2ffa1383586656b61080 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Sat, 6 Aug 2022 15:45:10 +0200 Subject: [PATCH] [neovim] Cleanup julia shim code. --- .julia/environments/nvim-lspconfig/Makefile | 26 ++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.julia/environments/nvim-lspconfig/Makefile b/.julia/environments/nvim-lspconfig/Makefile index 08fbd0b..d6108cf 100644 --- a/.julia/environments/nvim-lspconfig/Makefile +++ b/.julia/environments/nvim-lspconfig/Makefile @@ -38,23 +38,27 @@ packagecompiler/precompile_statements.jl: Manifest.toml bin/julia bin/julia: mkdir -p bin - rm -f bin/julia - echo "#!/bin/bash" > bin/julia - echo "JULIA=${JULIA}" >> bin/julia - echo "if [[ \$${JULIA_TRACE_COMPILE} = \"1\" ]]; then" >> bin/julia - echo " exec \$${JULIA} --trace-compile=${PWD}/packagecompiler/precompile_statements.jl \"\$$@\"" >> bin/julia - echo "elif [[ -f ${PWD}/$(SYSIMAGE) ]]; then" >> bin/julia - echo " exec \$${JULIA} --sysimage=${PWD}/$(SYSIMAGE) \"\$$@\"" >> bin/julia - echo "else" >> bin/julia - echo " exec \$${JULIA} \"\$$@\"" >> bin/julia - echo "fi" >> bin/julia - chmod +x bin/julia + echo "$$JULIA_SHIM" > $@ + chmod +x $@ clean: rm -rf $(SYSIMAGE) packagecompiler bin .PHONY: clean default +export JULIA_SHIM +define JULIA_SHIM +#!/bin/bash +JULIA=${JULIA} +if [[ $${JULIA_TRACE_COMPILE} = "1" ]]; then + exec $${JULIA} --trace-compile=${PWD}/packagecompiler/precompile_statements.jl "$$@" +elif [[ -f ${PWD}/$(SYSIMAGE) ]]; then + exec $${JULIA} --sysimage=${PWD}/$(SYSIMAGE) "$$@" +else + exec $${JULIA} "$$@" +fi +endef + export PACKAGE_CONTENT define PACKAGE_CONTENT # This file is opened in neovim with a LanguageServer.jl process that records Julia