better error on unknown build target #5

Open
opened 2026-10-25 15:19:03 +00:00 by firepear · 1 comment
Owner
$ ./fpcc build tms-media
jq: error: media/0 is not defined at <top-level>, line 1, column 13:
    .builds.tms-media
                ^^^^^
jq: 1 compile error

this is what happens when a build target contains a hyphen, and it's useless

when a build target doesn't exist and contains no hyphen, it's better but contains a formatting error:

$ ./fpcc build tmsfoo
error: no build 'tmsfoo in config /etc/tmc.json
       defined builds: tms_backend tms_media
``` $ ./fpcc build tms-media jq: error: media/0 is not defined at <top-level>, line 1, column 13: .builds.tms-media ^^^^^ jq: 1 compile error ``` this is what happens when a build target contains a hyphen, and it's useless when a build target doesn't exist and contains no hyphen, it's better but contains a formatting error: ``` $ ./fpcc build tmsfoo error: no build 'tmsfoo in config /etc/tmc.json defined builds: tms_backend tms_media ```
Author
Owner

This turned out to be a pretty easy fix: there already was a check for hyphens, but it was after the check for being defined... which relies on jq. Reordering things has cleared it up.

This turned out to be a pretty easy fix: there already was a check for hyphens, but it was _after_ the check for being defined... which relies on `jq`. Reordering things has cleared it up.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
firepear/fpc-ctl#5
No description provided.