-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add directory flag to read XMLs in immediate directory
- Loading branch information
Showing
9 changed files
with
118 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* eslint-disable no-await-in-loop */ | ||
import { readdir } from 'node:fs/promises'; | ||
import { join } from 'node:path'; | ||
|
||
export async function findFilesInDirectory(directories: string[]): Promise<{ files: string[]; warnings: string[] }> { | ||
const files: string[] = []; | ||
const warnings: string[] = []; | ||
for (const dir of directories) { | ||
try { | ||
const dirFiles = await readdir(dir, { withFileTypes: true }); | ||
const xmlFiles = dirFiles | ||
.filter((file) => file.isFile() && file.name.endsWith('.xml')) | ||
.map((file) => join(dir, file.name)); | ||
files.push(...xmlFiles); | ||
} catch (error) { | ||
warnings.push(`Failed to read directory ${dir}`); | ||
} | ||
} | ||
|
||
return { files, warnings }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Package xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<types> | ||
<members>Auto</members> | ||
<name>customlabel</name> | ||
</types> | ||
<types> | ||
<members>ABC</members> | ||
<members>Account</members> | ||
<members>Case</members> | ||
<name>customobject</name> | ||
</types> | ||
<types> | ||
<members>Glengarry_Leadz</members> | ||
<members>Industry</members> | ||
<name>standardvalueset</name> | ||
</types> | ||
<version>59.0</version> | ||
</Package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Package xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<type> | ||
<members>Lead.Always_Be_Closing__c</members> | ||
<members>Account.Coffee_is_for_closers__c</members> | ||
<name>CustomField</name> | ||
</type> | ||
<version>59.0</version> | ||
<version>57.0</version> | ||
</Package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Package xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<types> | ||
<members>ABC</members> | ||
<name>CustomObject</name> | ||
</types> | ||
<version>57.0</version> | ||
</Package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Package xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<types> | ||
<members>Glengarry_Leadz</members> | ||
<name>StandardValueSet</name> | ||
</types> | ||
<version>59.0</version> | ||
</Package> |