1
Fork 0
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:
Hörmet Yiltiz 2023-05-26 13:31:10 -05:00 committed by GitHub
parent 4b82839c90
commit 272b7e2b93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 26 deletions

View file

@ -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 {[]}
}