Skip to content

Commit

Permalink
show the failed themes at the end and tidy up main
Browse files Browse the repository at this point in the history
  • Loading branch information
amtoine committed Jul 20, 2024
1 parent 1eecae7 commit fef9612
Showing 1 changed file with 12 additions and 28 deletions.
40 changes: 12 additions & 28 deletions themes/src/make.nu
Original file line number Diff line number Diff line change
Expand Up @@ -219,38 +219,22 @@ def main [] {

try { git clone $LEMNOS_SOURCE.remote_repo $LEMNOS_SOURCE.local_repo }

let lemnos_failed = ls $LEMNOS_SOURCE.dir
| get name
| path parse
| get stem
| each {|theme|
info -n $"Converting ($theme) \r"
let themes = ls $LEMNOS_SOURCE.dir
| insert source "lemnos"
| append (ls $CUSTOM_SOURCE.dir | insert source "custom")
| update name { path parse | get stem }
| select name source

let failed = $themes | each { |t|
info -n $"Converting ($t.name) \r"
try {
make_theme $theme
} catch {|e|
err $"Converting ($theme) failed: ($e.msg)"
$theme
make_theme $t.name $t.source
} catch { |e|
err $"Converting ($t.name) failed: ($e.msg)"
$t
}
}

let custom_failed = ls $CUSTOM_SOURCE.dir
| get name
| path parse
| get stem
| each {|theme|
info -n $"Converting ($theme) \r"
try {
make_theme $theme "custom"
} catch {|e|
err $"Converting ($theme) failed: ($e.msg)"
$theme
}
}

let failed = $custom_failed | wrap name | insert source "custom" | append (
$lemnos_failed | wrap name | insert source "lemnos"
)

print ''
if not ($failed | is-empty) {
warn "The following themes have failed:"
Expand Down

0 comments on commit fef9612

Please sign in to comment.