Skip to content

Commit 2089364

Browse files
committed
fix: modify readOrgList function
1 parent 94571a9 commit 2089364

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/commands/package/pushupgrade/schedule.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77
import fs from 'node:fs/promises';
8-
import * as csv from 'csv-parse/sync';
98
import { Flags, SfCommand, orgApiVersionFlagWithDeprecations } from '@salesforce/sf-plugins-core';
109
import { Messages, SfError } from '@salesforce/core';
1110
import { PackagePushScheduleResult, PackagePushUpgrade } from '@salesforce/packaging';
@@ -76,13 +75,13 @@ function isValidPackageVersionId(id: string): boolean {
7675
async function readOrgListFile(filePath: string): Promise<string[]> {
7776
try {
7877
const fileContent = await fs.readFile(filePath, 'utf-8');
79-
const records = csv.parse(fileContent, { columns: false, skipEmptyLines: true }) as string[][];
78+
const orgIds = fileContent.split(/\s+/).filter((id) => id.length > 0);
8079

81-
if (records.length === 0) {
80+
if (orgIds.length === 0) {
8281
throw new SfError(messages.getMessage('error.empty-org-list'));
8382
}
8483

85-
return records.map((row: string[]) => row[0]).filter((id: string) => /^00D[a-zA-Z0-9]{15}$/.test(id));
84+
return orgIds.filter((id: string) => /^00D[a-zA-Z0-9]{12}$/.test(id));
8685
} catch (error) {
8786
throw new SfError(messages.getMessage('error.invalid-org-list-file'));
8887
}

0 commit comments

Comments
 (0)