File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
src/commands/package/pushupgrade Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 5
5
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
6
*/
7
7
import fs from 'node:fs/promises' ;
8
- import * as csv from 'csv-parse/sync' ;
9
8
import { Flags , SfCommand , orgApiVersionFlagWithDeprecations } from '@salesforce/sf-plugins-core' ;
10
9
import { Messages , SfError } from '@salesforce/core' ;
11
10
import { PackagePushScheduleResult , PackagePushUpgrade } from '@salesforce/packaging' ;
@@ -76,13 +75,13 @@ function isValidPackageVersionId(id: string): boolean {
76
75
async function readOrgListFile ( filePath : string ) : Promise < string [ ] > {
77
76
try {
78
77
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 ) ;
80
79
81
- if ( records . length === 0 ) {
80
+ if ( orgIds . length === 0 ) {
82
81
throw new SfError ( messages . getMessage ( 'error.empty-org-list' ) ) ;
83
82
}
84
83
85
- return records . map ( ( row : string [ ] ) => row [ 0 ] ) . filter ( ( id : string ) => / ^ 0 0 D [ a - z A - Z 0 - 9 ] { 15 } $ / . test ( id ) ) ;
84
+ return orgIds . filter ( ( id : string ) => / ^ 0 0 D [ a - z A - Z 0 - 9 ] { 12 } $ / . test ( id ) ) ;
86
85
} catch ( error ) {
87
86
throw new SfError ( messages . getMessage ( 'error.invalid-org-list-file' ) ) ;
88
87
}
You can’t perform that action at this time.
0 commit comments