From a336967ae3e85e9487a246345b2ed81ce0e11d34 Mon Sep 17 00:00:00 2001 From: Alex Lavrov <36633600+alexslavr@users.noreply.github.com> Date: Fri, 5 Jan 2024 22:00:08 +0400 Subject: [PATCH] Build scripts: Replace single quotes with double quotes for compatibility with Windows (#26408) --- build/common/shell-utils.test.ts | 8 ++++---- build/common/shell-utils.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build/common/shell-utils.test.ts b/build/common/shell-utils.test.ts index 8f75177795be..b78dd795d042 100644 --- a/build/common/shell-utils.test.ts +++ b/build/common/shell-utils.test.ts @@ -3,12 +3,12 @@ import { mapOptions } from './shell-utils'; describe('shell utils', () => { test.each([ - { options: { a: 123 }, map: { a: 'x' }, expected: `x='123'` }, - { options: { a: 'def' }, map: { a: 'x' }, expected: `x='def'` }, + { options: { a: 123 }, map: { a: 'x' }, expected: `x="123"` }, + { options: { a: 'def' }, map: { a: 'x' }, expected: `x="def"` }, { options: { a: true }, map: { a: { kind: 'flag', alias: 'x' } }, expected: 'x' }, { options: { a: false }, map: { a: { kind: 'flag', alias: 'x' } }, expected: '' }, - { options: { b: 123, a: true, c: 'def' }, map: { a: { kind: 'flag', alias: 'x' }, b: 'y', c: 'z' }, expected: `y='123' x z='def'` }, - { options: { b: 123, a: false, c: 'def' }, map: { a: { kind: 'flag', alias: 'x' }, b: 'y', c: 'z' }, expected: `y='123' z='def'` }, + { options: { b: 123, a: true, c: 'def' }, map: { a: { kind: 'flag', alias: 'x' }, b: 'y', c: 'z' }, expected: `y="123" x z="def"` }, + { options: { b: 123, a: false, c: 'def' }, map: { a: { kind: 'flag', alias: 'x' }, b: 'y', c: 'z' }, expected: `y="123" z="def"` }, ] as const)('mapOptions', ({ options, map, expected }) => { expect(mapOptions(options, map as any)).toBe(expected); }); diff --git a/build/common/shell-utils.ts b/build/common/shell-utils.ts index 45f261153ad3..8cd6eefc5416 100644 --- a/build/common/shell-utils.ts +++ b/build/common/shell-utils.ts @@ -4,7 +4,7 @@ function mapKeyValue(key: string, value: unknown, map: Record): const mapping = key in map ? map[key] : undefined; if (mapping !== undefined) { if (typeof (mapping) === 'string') { - return `${mapping}='${value}'`; + return `${mapping}="${value}"`; } if (mapping.kind === 'flag') { @@ -12,7 +12,7 @@ function mapKeyValue(key: string, value: unknown, map: Record): } } - return `${key}='${value}'`; + return `${key}="${value}"`; } export function mapOptions>(options: TOptions, map: Record): string {