From 20e7f992a8d3a0bc09b14f5c396e1d8b317ec2e2 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron <886074+teto@users.noreply.github.com> Date: Thu, 26 Jun 2025 10:53:26 +0200 Subject: [PATCH] feat: obsoletes "require("avante_lib").load()" (#2324) --- Makefile | 4 ++-- build.sh | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 978dac1..23a14e1 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ endif LUA_VERSIONS := luajit lua51 -BUILD_DIR := build +BUILD_DIR := lua BUILD_FROM_SOURCE ?= false TARGET_LIBRARY ?= all @@ -68,7 +68,7 @@ $(BUILD_DIR): @mkdir -p $(BUILD_DIR) clean: - @rm -rf $(BUILD_DIR) + @rm -rf $(BUILD_DIR)/*.$(EXT) luacheck: @luacheck `find -name "*.lua"` --codes diff --git a/build.sh b/build.sh index 1b4c34f..47e71db 100644 --- a/build.sh +++ b/build.sh @@ -8,7 +8,7 @@ REPO_NAME="avante.nvim" SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" # Set the target directory to clone the artifact -TARGET_DIR="${SCRIPT_DIR}/build" +TARGET_DIR="${SCRIPT_DIR}/lua" # Get the artifact download URL based on the platform and Lua version case "$(uname -s)" in @@ -79,10 +79,10 @@ fi fetch_remote_tags latest_tag="$(git describe --tags --abbrev=0 || true)" # will be empty in clone repos -built_tag="$(cat build/.tag 2>/dev/null || true)" +built_tag="$(cat "${TARGET_DIR}/.tag" 2>/dev/null || true)" save_tag() { - echo "$latest_tag" > build/.tag + echo "$latest_tag" > "${TARGET_DIR}/.tag" } if [[ "$latest_tag" = "$built_tag" && -n "$latest_tag" ]]; then @@ -107,6 +107,6 @@ else echo "No latest tag found. Building from source." cargo build --release --features=$LUA_VERSION for f in target/release/lib*.$LIB_EXT; do - cp "$f" "build/$(echo $f | sed 's#.*/lib##')" + cp "$f" "${TARGET_DIR}/$(echo $f | sed 's#.*/lib##')" done fi