feat: obsoletes "require("avante_lib").load()" (#2324)
This commit is contained in:
4
Makefile
4
Makefile
@@ -13,7 +13,7 @@ endif
|
|||||||
|
|
||||||
LUA_VERSIONS := luajit lua51
|
LUA_VERSIONS := luajit lua51
|
||||||
|
|
||||||
BUILD_DIR := build
|
BUILD_DIR := lua
|
||||||
BUILD_FROM_SOURCE ?= false
|
BUILD_FROM_SOURCE ?= false
|
||||||
TARGET_LIBRARY ?= all
|
TARGET_LIBRARY ?= all
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ $(BUILD_DIR):
|
|||||||
@mkdir -p $(BUILD_DIR)
|
@mkdir -p $(BUILD_DIR)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -rf $(BUILD_DIR)
|
@rm -rf $(BUILD_DIR)/*.$(EXT)
|
||||||
|
|
||||||
luacheck:
|
luacheck:
|
||||||
@luacheck `find -name "*.lua"` --codes
|
@luacheck `find -name "*.lua"` --codes
|
||||||
|
|||||||
8
build.sh
8
build.sh
@@ -8,7 +8,7 @@ REPO_NAME="avante.nvim"
|
|||||||
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
|
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
|
||||||
|
|
||||||
# Set the target directory to clone the artifact
|
# 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
|
# Get the artifact download URL based on the platform and Lua version
|
||||||
case "$(uname -s)" in
|
case "$(uname -s)" in
|
||||||
@@ -79,10 +79,10 @@ fi
|
|||||||
|
|
||||||
fetch_remote_tags
|
fetch_remote_tags
|
||||||
latest_tag="$(git describe --tags --abbrev=0 || true)" # will be empty in clone repos
|
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() {
|
save_tag() {
|
||||||
echo "$latest_tag" > build/.tag
|
echo "$latest_tag" > "${TARGET_DIR}/.tag"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ "$latest_tag" = "$built_tag" && -n "$latest_tag" ]]; then
|
if [[ "$latest_tag" = "$built_tag" && -n "$latest_tag" ]]; then
|
||||||
@@ -107,6 +107,6 @@ else
|
|||||||
echo "No latest tag found. Building from source."
|
echo "No latest tag found. Building from source."
|
||||||
cargo build --release --features=$LUA_VERSION
|
cargo build --release --features=$LUA_VERSION
|
||||||
for f in target/release/lib*.$LIB_EXT; do
|
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
|
done
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user