From c3d0936929ea4b5c53f66a270ce06e56f6c7141d Mon Sep 17 00:00:00 2001 From: mshanemc Date: Tue, 6 Dec 2022 14:08:01 -0600 Subject: [PATCH] fix: os-relevant EOL --- src/commands/dev/convert/messages.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/commands/dev/convert/messages.ts b/src/commands/dev/convert/messages.ts index 5b781a5f..536e94c0 100644 --- a/src/commands/dev/convert/messages.ts +++ b/src/commands/dev/convert/messages.ts @@ -5,6 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ import * as fs from 'fs'; +import { EOL } from 'os'; import { SfCommand, Flags } from '@salesforce/sf-plugins-core'; import { Messages } from '@salesforce/core'; @@ -62,12 +63,12 @@ export default class DevConvertMessages extends SfCommand): string => { if (typeof value === 'string') { - return `# ${key}\n\n${value.trim()}`; + return `# ${key}${EOL}${EOL}${value.trim()}`; } else if (Array.isArray(value)) { - return [`# ${key}`, '\n\n- ' + value.join('\n\n- ')].join(''); + return [`# ${key}`, `${EOL}${EOL}- ` + value.join(`${EOL}${EOL}- `)].join(''); } else { return Object.entries(value) .map(([subkey, subvalue]) => convertValue(`${key}.${subkey}`, subvalue)) - .join('\n\n'); + .join(`${EOL}${EOL}`); } };