Skip to content

Commit 9806b02

Browse files
committed
Show file argument in plt build help and resolve its relative paths
Apply the same help example and BUILD_WORKING_DIRECTORY path resolution to plt build: the playlist argument and --out are now resolved against the invoking directory under 'bazel run'.
1 parent a0d3085 commit 9806b02

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

cmd/plt_build.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@ var (
3535
)
3636

3737
var pltBuildCmd = &coral.Command{
38-
Use: "build <playlist>",
38+
Use: "build <playlist-file>",
3939
Short: "Download media and build a play-ready working directory.",
4040
Long: `Parse a purple playlist, download every referenced video at the chosen
4141
resolution, pre-cut verse clips, and write a self-contained working directory
4242
with ordered clips, a JSON cue sheet, and a Typst cue sheet (compiled to PDF
4343
when typst is installed).`,
44+
Example: ` vbs plt build meeting.playlist
45+
vbs plt build --resolution 480p --out ./shows meeting.playlist`,
4446
Run: runPltBuild,
4547
Args: coral.ExactArgs(1),
4648
}
@@ -74,9 +76,10 @@ func runPltBuild(_ *coral.Command, args []string) {
7476
log.Fatal().Msg("media API endpoint is not configured; set the config key plt.mediaapi (or pass --media-api)")
7577
}
7678

77-
arc, err := sniffPlaylist(args[0])
79+
path := resolveInputPath(args[0])
80+
arc, err := sniffPlaylist(path)
7881
if err != nil {
79-
log.Fatal().Err(err).Msgf("Not a valid purple playlist: %s", args[0])
82+
log.Fatal().Err(err).Msgf("Not a valid purple playlist: %s", path)
8083
}
8184
defer func() { _ = arc.Close() }()
8285

@@ -154,7 +157,7 @@ func newBuildContext(arc *archive, playlist *Playlist, base string) (*buildConte
154157
}
155158
cacheDir := filepath.Join(userCache, "vbs", "media")
156159

157-
outDir := filepath.Join(pltBuildOut, slugify(playlist.Name))
160+
outDir := filepath.Join(resolveInputPath(pltBuildOut), slugify(playlist.Name))
158161
for _, sub := range []string{"clips", "media", "thumbs"} {
159162
if err := os.MkdirAll(filepath.Join(outDir, sub), 0o755); err != nil {
160163
return nil, fmt.Errorf("could not create %s: %w", sub, err)

0 commit comments

Comments
 (0)