mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
fix(elvish): prepend asdf paths to $PATH
(#1174)
* fix(elvish): prepend asdf paths to `$PATH` * refactor(elvish): minor improvements
This commit is contained in:
parent
e0d27e6c3c
commit
682b7a1d6d
9
asdf.elv
9
asdf.elv
@ -1,9 +1,8 @@
|
|||||||
|
use path
|
||||||
use re
|
use re
|
||||||
use str
|
use str
|
||||||
use path
|
|
||||||
|
|
||||||
var asdf_dir = $E:HOME'/.asdf'
|
var asdf_dir = ~'/.asdf'
|
||||||
if (and (has-env ASDF_DIR) (!=s $E:ASDF_DIR '')) {
|
if (and (has-env ASDF_DIR) (!=s $E:ASDF_DIR '')) {
|
||||||
set asdf_dir = $E:ASDF_DIR
|
set asdf_dir = $E:ASDF_DIR
|
||||||
} else {
|
} else {
|
||||||
@ -32,7 +31,7 @@ fn asdf {|command @args|
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn match {|argz @pats|
|
fn match {|argz @pats|
|
||||||
var matched = $true;
|
var matched = $true
|
||||||
if (!= (count $argz) (count $pats)) {
|
if (!= (count $argz) (count $pats)) {
|
||||||
set matched = $false
|
set matched = $false
|
||||||
} else {
|
} else {
|
||||||
@ -88,8 +87,8 @@ for path [
|
|||||||
] {
|
] {
|
||||||
if (not (has-value $paths $path)) {
|
if (not (has-value $paths $path)) {
|
||||||
set paths = [
|
set paths = [
|
||||||
$@paths
|
|
||||||
$path
|
$path
|
||||||
|
$@paths
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user