Skip to content
This repository was archived by the owner on Jan 29, 2024. It is now read-only.

Commit e78e71f

Browse files
committed
validate the icon exists for hac
1 parent 6ab6bc2 commit e78e71f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/types/hac.nim

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
include console
22

3+
import sequtils
4+
35
type
46
Hac* = ref object of Console
57

@@ -34,9 +36,14 @@ method publish*(this: Hac, cfg: Config): bool =
3436
let icon = fmt("{cfg.build.icon}.{this.getIconExtension()}")
3537

3638
# Set the args for hbupdater
37-
let args = @[check.path, cfg.metadata.name, cfg.metadata.author, icon,
39+
var args = @[check.path, cfg.metadata.name, cfg.metadata.author, icon,
3840
cfg.output.buildDir / fmt("{outputName}.nro")]
3941

42+
var execCmd = Command.HacUpdate
43+
if (not os.fileExists(icon)):
44+
delete(args, 3 .. 3)
45+
execCmd = Command.HacUpdateNoIcon
46+
4047
if (not command.run($Command.HacUpdate, args)):
4148
return false
4249

0 commit comments

Comments
 (0)