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.ps1 | |
| 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.ps1')
| -rw-r--r-- | mingling_cli/scripts/load_mling.ps1 | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/mingling_cli/scripts/load_mling.ps1 b/mingling_cli/scripts/load_mling.ps1 new file mode 100644 index 0000000..e3989a6 --- /dev/null +++ b/mingling_cli/scripts/load_mling.ps1 @@ -0,0 +1,21 @@ +$ScriptDir = if ($PSScriptRoot) { $PSScriptRoot } else { Split-Path -Parent $MyInvocation.MyCommand.Path } + +$env:PATH = "$ScriptDir\bin;$env:PATH" + +if (Test-Path -PathType Leaf "$ScriptDir\scripts\mling_comp.ps1") { + . "$ScriptDir\scripts\mling_comp.ps1" +} + +foreach ($pkgDir in (& mingling-cli __loadpkgs_path 2>$null)) { + if (-not [string]::IsNullOrWhiteSpace($pkgDir) -and (Test-Path -PathType Container $pkgDir)) { + if ($env:PATH -notmatch [regex]::Escape($pkgDir)) { + $env:PATH = "$pkgDir;$env:PATH" + } + } +} + +foreach ($script in (& mingling-cli __loadpkgs_comp_scripts 2>$null)) { + if ($script -like '*.ps1' -and (Test-Path -PathType Leaf $script)) { + . $script + } +} |
