File tree Expand file tree Collapse file tree 5 files changed +11
-154
lines changed Expand file tree Collapse file tree 5 files changed +11
-154
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 3
3
# - 1.0.1 is a valid directory name.
4
4
# - yeah_whatever_linter is not a valid directory name.
5
5
def ls-incorrect-dirs [] {
6
- ls | where type == ' Dir ' and name != ' scripts' | match - v name ' (\d+\.){2,}\d$'
6
+ ls | where type == dir and name != ' scripts' | find -- invert -- regex ' (\d+\.){2,}\d$' -- columns [ name ]
7
7
}
8
8
let incorrect_count = (ls-incorrect-dirs | length );
9
9
if $incorrect_count > 0 {
10
- # echo ` The following directories are named incorrectly: {{ (char newline)}}`
11
- $" The following directories are named incorrectly: ( char newline ) "
12
- ls-incorrect-dirs
13
- exit 1
14
- } {
15
- exit 0
10
+ print $" The following directories are named incorrectly: (char newline )"
11
+ print ( ls-incorrect-dirs )
12
+ exit 1
13
+
14
+ } else {
15
+ exit 0
16
16
}
Original file line number Diff line number Diff line change @@ -12,9 +12,7 @@ let m_table = (
12
12
]
13
13
)
14
14
let now = (date now )
15
- $m_table | update time {
16
- each { |name |
17
- $now | date to-timezone ($name | get tz ) | date format ' %c'
18
- }
15
+ $m_table | update time {|row |
16
+ $now | date to-timezone ($row | get tz ) | format date ' %c'
19
17
}
20
18
Original file line number Diff line number Diff line change @@ -17,14 +17,14 @@ let nu_table = ($nu_files |
17
17
let cat = ($it.File | path dirname )
18
18
if $cat == " " {
19
19
" not assigned yet"
20
- } {
20
+ } else {
21
21
$cat
22
22
}
23
23
} | where Category !~ " .git" | select Category File | sort-by Category )
24
24
25
25
# Let's fix the file now
26
26
let nu_table = ($nu_table | update File { |it |
27
- let file_path = ($it.File | into string | str find- replace ' \\ ' ' /' )
27
+ let file_path = ($it.File | into string | str replace ' \' ' /' -- all )
28
28
let file_name = ($file_path | path basename )
29
29
$" [($file_name )](char lparen )./($file_path )(char rparen )"
30
30
})
You can’t perform that action at this time.
0 commit comments