Remove Rust code, delegate server to nuwiki-rs repo
Delete all Rust crates (crates/) and Cargo files. The nuwiki-ls binary is now built in the separate nuwiki-rs repository and downloaded at install time from the Gitea release assets, with a cargo build fallback that clones nuwiki-rs. Update all documentation to reflect the split repo layout.
This commit is contained in:
+27
-13
@@ -10,7 +10,7 @@
|
||||
# Exports:
|
||||
# REPO_ROOT / DEV_DIR / WIKI_DIR — common paths
|
||||
# log — prefixed status line
|
||||
# ensure_binary — build + symlink nuwiki-ls
|
||||
# ensure_binary — verify nuwiki-ls exists (download if missing)
|
||||
# write_sample_wiki DIR — lay down the feature-showcase wiki
|
||||
# reset_dirs DIR... — wipe + recreate owned state dirs
|
||||
# seed_wiki — (re)seed WIKI_DIR fresh each run; never
|
||||
@@ -27,20 +27,34 @@ log() { printf '\033[1;34m[nuwiki-dev]\033[0m %s\n' "$*"; }
|
||||
|
||||
ensure_binary() {
|
||||
local bin="$REPO_ROOT/bin/nuwiki-ls"
|
||||
local built="$REPO_ROOT/target/release/nuwiki-ls"
|
||||
if [[ "${NUWIKI_DEV_SKIP_BUILD:-0}" == "1" ]]; then
|
||||
if [[ ! -x "$bin" ]]; then
|
||||
log "NUWIKI_DEV_SKIP_BUILD=1 but $bin is missing — building anyway"
|
||||
else
|
||||
log "NUWIKI_DEV_SKIP_BUILD=1 — using existing $bin"
|
||||
return
|
||||
fi
|
||||
if [[ -x "$bin" ]]; then
|
||||
log "binary ready: $bin"
|
||||
return
|
||||
fi
|
||||
if [[ "${NUWIKI_DEV_SKIP_BUILD:-0}" == "1" ]]; then
|
||||
log "NUWIKI_DEV_SKIP_BUILD=1 but $bin is missing"
|
||||
return 1
|
||||
fi
|
||||
log "downloading nuwiki-ls…"
|
||||
vim -e -s -c "source $REPO_ROOT/scripts/download_bin.vim" -c "q"
|
||||
if [[ -x "$bin" ]]; then
|
||||
log "binary ready: $bin"
|
||||
return
|
||||
fi
|
||||
log "download failed, falling back to cargo build from nuwiki-rs…"
|
||||
local rs_repo="$REPO_ROOT/nuwiki-rs"
|
||||
if [[ ! -f "$rs_repo/Cargo.toml" ]]; then
|
||||
log "cloning nuwiki-rs …"
|
||||
git clone --depth 1 https://code.gfran.co/gffranco/nuwiki-rs.git "$rs_repo"
|
||||
fi
|
||||
cargo build --release -p nuwiki-ls --manifest-path "$rs_repo/Cargo.toml"
|
||||
if [[ ! -f "$rs_repo/target/release/nuwiki-ls" ]]; then
|
||||
log "cargo build failed"
|
||||
return 1
|
||||
fi
|
||||
log "building nuwiki-ls (release)…"
|
||||
cargo build --release -p nuwiki-ls --manifest-path "$REPO_ROOT/Cargo.toml"
|
||||
mkdir -p "$REPO_ROOT/bin"
|
||||
ln -sf "$built" "$bin"
|
||||
log "binary ready: $bin (built $(date -r "$built" '+%Y-%m-%d %H:%M:%S'))"
|
||||
ln -sf "$rs_repo/target/release/nuwiki-ls" "$bin"
|
||||
log "binary ready: $bin"
|
||||
}
|
||||
|
||||
# write_sample_wiki DIR — lay down a fixture that exercises every vimwiki
|
||||
|
||||
Reference in New Issue
Block a user