Skip to content

Commit c0419df

Browse files
refactor: remove unused copyFilesToMpk and getOssFiles functions from commons.d.ts
fix: ensure additionalFiles is an array before processing in exportModuleWithWidgets
1 parent 6cb0ff7 commit c0419df

2 files changed

Lines changed: 4 additions & 13 deletions

File tree

scripts/release/module-automation/commons.d.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,3 @@ export function exportModuleWithWidgets(
1818
nativeWidgetFolders: string[],
1919
ossFiles?: Array<{ src: string; dest: string }>
2020
): Promise<void>;
21-
22-
export function copyFilesToMpk(
23-
files: Array<{ src: string; dest: string }>,
24-
mpkOutput: string,
25-
moduleNameInModeler: string
26-
): Promise<void>;
27-
28-
export function getOssFiles(
29-
folderPath: string,
30-
isOssReadmeRequired: boolean
31-
): Promise<Array<{ src: string; dest: string }>>;

scripts/release/module-automation/commons.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,10 @@ async function exportModuleWithWidgets(moduleName, mpkOutput, widgetsFolders, ad
299299
throw new Error(`Including widgets in module failed. package.xml of widget/module ${moduleName} not found`);
300300
}
301301
// Add additional files to the MPK
302-
for await (const file of additionalFiles) {
303-
await copyFile(file.src, join(projectPath, file.dest));
302+
if (Array.isArray(additionalFiles)) {
303+
for await (const file of additionalFiles) {
304+
await copyFile(file.src, join(projectPath, file.dest));
305+
}
304306
}
305307
// Re-zip and rename
306308
await zip(projectPath, moduleName);

0 commit comments

Comments
 (0)