Skip to content

Commit 4f0af63

Browse files
committed
fix(cli): beats names the folder for a composition file and syncs the skills manifest
1 parent 880af68 commit 4f0af63

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

‎packages/cli/src/commands/beats.test.ts‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,15 @@ describe.skipIf(!canDecode)("hyperframes beats", () => {
9494
const song = join(project("file-arg", 120), "assets", "song.wav");
9595
const { exitCode, out } = await runBeats(song);
9696
expect(exitCode).toBe(1);
97-
expect(out).toContain(`hyperframes audio ${song} --only beats --json`);
97+
expect(out).toContain(`hyperframes audio ${JSON.stringify(song)} --only beats --json`);
98+
});
99+
100+
it("tells a composition file argument to pass its folder", async () => {
101+
const dir = project("html-arg", 120);
102+
const { exitCode, out } = await runBeats(join(dir, "index.html"));
103+
expect(exitCode).toBe(1);
104+
expect(out).toContain(`hyperframes beats ${JSON.stringify(dir)}`);
105+
expect(out).not.toContain("hyperframes audio");
98106
});
99107

100108
it("writes nothing for a track with no steady beat", async () => {

‎packages/cli/src/commands/beats.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,12 @@ export default defineCommand({
103103
},
104104
async run({ args }) {
105105
if (args.dir && existsSync(resolve(args.dir)) && statSync(resolve(args.dir)).isFile()) {
106+
const file = JSON.stringify(args.dir);
106107
fail(
107-
`${args.dir} is a file; beats takes a project folder. ` +
108-
`For one audio or video file run: hyperframes audio ${args.dir} --only beats --json`,
108+
/\.html?$/i.test(args.dir)
109+
? `${args.dir} is a file; beats takes the project folder: hyperframes beats ${JSON.stringify(dirname(args.dir))}`
110+
: `${args.dir} is a file; beats takes a project folder. ` +
111+
`For one audio or video file run: hyperframes audio ${file} --only beats --json`,
109112
);
110113
}
111114
const project = resolveProject(args.dir);

‎skills-manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"files": 77
1111
},
1212
"hyperframes-cli": {
13-
"hash": "49fa62fa12913672",
13+
"hash": "433959bc422463f4",
1414
"files": 13
1515
},
1616
"hyperframes-registry": {

0 commit comments

Comments
 (0)