mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-02 23:27:45 +00:00
auto-venv for python: update to be compatible with nu 0.80 (#513)
* auto-venv python passes syntax checks * update readme.md * everything works!
This commit is contained in:
parent
4b82839c90
commit
272b7e2b93
5 changed files with 32 additions and 26 deletions
|
@ -14,7 +14,7 @@ export def "path walk" [
|
|||
] {
|
||||
let list = ($path | path expand | path split);
|
||||
|
||||
$list | each -n { |$part| (
|
||||
$list | enumerate | each { |$part| (
|
||||
$list | first ($part.index + 1) | path join;
|
||||
)}
|
||||
|
||||
|
@ -24,12 +24,12 @@ export def "path walk" [
|
|||
export def "path check-sub" [
|
||||
folder: any,
|
||||
subfolder: string,
|
||||
--type: string
|
||||
--type: list
|
||||
] {
|
||||
|
||||
(ls -a $folder
|
||||
| where (
|
||||
($type == $nothing or $it.type == $type)
|
||||
($type == $nothing or $it.type in $type)
|
||||
and ($it.name | path basename) == $subfolder
|
||||
)
|
||||
| length
|
||||
|
@ -43,9 +43,9 @@ export def "path check-sub" [
|
|||
export def "path find-sub" [
|
||||
folder: any,
|
||||
subfolder: string,
|
||||
--type: string
|
||||
--type: list
|
||||
] {
|
||||
let paths = path walk $folder;
|
||||
let paths = (path walk $folder);
|
||||
|
||||
let paths = ( $paths
|
||||
| where (
|
||||
|
@ -55,5 +55,5 @@ export def "path find-sub" [
|
|||
|
||||
if ($paths != $nothing) and ($paths | length) > 0 {
|
||||
[ ($paths | first), $subfolder ] | path join
|
||||
}
|
||||
}
|
||||
} else {[]}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue