Skip to content

Commit 0c73f45

Browse files
authored
Merge pull request #47 from MiniMax-AI-Dev/fix/subject-ref-url-truncation
fix(image): prevent URL truncation in --subject-ref parsing
2 parents 597c678 + 1251b18 commit 0c73f45

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/commands/image/generate.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ export default defineCommand({
5656
if (flags.subjectRef) {
5757
const refStr = flags.subjectRef as string;
5858
const params = Object.fromEntries(
59-
refStr.split(',').map(p => p.split('=') as [string, string]),
59+
refStr.split(',').map(p => {
60+
const eqIdx = p.indexOf('=');
61+
if (eqIdx === -1) return [p, ''];
62+
return [p.slice(0, eqIdx), p.slice(eqIdx + 1)];
63+
}),
6064
);
6165

6266
const ref: { type: string; image_url?: string; image_file?: string } = {

0 commit comments

Comments
 (0)