Skip to content

Commit aef00d8

Browse files
jordanverasamyericlee878
authored andcommitted
remove extra newline from bulk mutation variables
1 parent e649cb3 commit aef00d8

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

packages/app/src/cli/services/bulk-operations/stage-file.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ describe('stageFile', () => {
6969
const uploadedBlob = fileAppendCall?.[1] as Blob
7070
const uploadedContent = await uploadedBlob?.text()
7171

72-
expect(uploadedContent).toBe('{"input":{"id":"gid://shopify/Product/123","tags":["test"]}}\n')
72+
expect(uploadedContent).toBe('{"input":{"id":"gid://shopify/Product/123","tags":["test"]}}')
7373
})
7474

7575
test('handles JSONL with multiple lines correctly', async () => {
@@ -94,7 +94,6 @@ describe('stageFile', () => {
9494
'{"input":{"id":"gid://shopify/Product/1","title":"New Shirt"}}',
9595
'{"input":{"id":"gid://shopify/Product/2","title":"Cool Pants"}}',
9696
'{"input":{"id":"gid://shopify/Product/3","title":"Nice Hat"}}',
97-
'',
9897
].join('\n')
9998

10099
expect(uploadedContent).toBe(expectedContent)

packages/app/src/cli/services/bulk-operations/stage-file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface StageFileOptions {
1818
export async function stageFile(options: StageFileOptions): Promise<string> {
1919
const {adminSession, variablesJsonl} = options
2020

21-
const buffer = Buffer.from(variablesJsonl ? `${variablesJsonl}\n` : '', 'utf-8')
21+
const buffer = Buffer.from(variablesJsonl ?? '', 'utf-8')
2222
const filename = 'bulk-variables.jsonl'
2323
const size = buffer.length
2424

0 commit comments

Comments
 (0)