diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-08-07 16:41:08 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-08-07 16:57:24 +0800 |
| commit | cc76b514a96331ca852d5a6cb1efabb72163722d (patch) | |
| tree | 8ac171df0a9ff4c9c9c93f5cfe2eea76a8b83a3a /mingling_cli/scripts/load_mling.sh | |
| parent | 81aa8266886d0dfb2961a9035a6f0b811b98be4f (diff) | |
build: replace cargo install with local release build in scripts
Update install scripts to build from manifest and copy binaries
manually instead of using `cargo install`. Add load scripts for
bash, zsh, fish, and PowerShell to set up PATH and source
completion scripts from external packages.
Diffstat (limited to 'mingling_cli/scripts/load_mling.sh')
| -rw-r--r-- | mingling_cli/scripts/load_mling.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/mingling_cli/scripts/load_mling.sh b/mingling_cli/scripts/load_mling.sh new file mode 100644 index 0000000..db0d79e --- /dev/null +++ b/mingling_cli/scripts/load_mling.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +MLING_SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" + +export PATH="$MLING_SCRIPT_DIR/bin:$PATH" + +if [[ -f "$MLING_SCRIPT_DIR/scripts/mling_comp.sh" ]]; then + source "$MLING_SCRIPT_DIR/scripts/mling_comp.sh" +fi + +while IFS= read -r pkg_dir; do + [[ -z "$pkg_dir" || ! -d "$pkg_dir" ]] && continue + case ":$PATH:" in + *":$pkg_dir:"*) ;; + *) export PATH="$pkg_dir:$PATH" ;; + esac +done < <(mingling-cli __loadpkgs_path 2>/dev/null) + +while IFS= read -r script; do + [[ "$script" == *.sh && -f "$script" ]] || continue + source "$script" +done < <(mingling-cli __loadpkgs_comp_scripts 2>/dev/null) |
