Skip to content

Commit a2ff25b

Browse files
authored
Fix widget build script (#112)
2 parents 53b9a53 + 439f691 commit a2ff25b

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"setup-android": "node ./detox/scripts/setup-android.js",
3636
"setup-ios": "node ./detox/scripts/setup-ios.js",
3737
"patch-package": "./scripts/patch/patch-package.sh",
38-
"build:widgets": "node ./scripts/buildWidgets.js"
38+
"build:widgets": "node ./scripts/widget/buildWidgets.js"
3939
},
4040
"workspaces": {
4141
"packages": [

scripts/widget/buildWidgets.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const deleteDistFolders = () => {
4343
}
4444

4545
log.info("Deleting 'dist' folders in 'packages/pluggableWidgets/*'...");
46-
const distFolderPath = path.join(__dirname, "..", "packages", "pluggableWidgets");
46+
const distFolderPath = path.join(__dirname, "..", "..", "packages", "pluggableWidgets");
4747
fs.readdir(distFolderPath, { withFileTypes: true }, (err, files) => {
4848
if (err) {
4949
log.error(`Error reading directories: ${err}`);
@@ -101,8 +101,11 @@ const runYarnBuild = () => {
101101
const copyMPKFiles = () => {
102102
return new Promise((resolve, reject) => {
103103
log.info("Copying '.mpk' files to 'dist/pluggableWidgets'...");
104-
const widgetsFolderPath = path.join(__dirname, "..", "packages", "pluggableWidgets");
105-
const destinationFolderPath = path.join(__dirname, "..", "dist", "pluggableWidgets");
104+
const widgetsFolderPath = path.join(__dirname, "..", "..", "packages", "pluggableWidgets");
105+
const destinationFolderPath = path.join(__dirname, "..", "..", "dist", "pluggableWidgets");
106+
107+
console.log("widgetsFolderPath", widgetsFolderPath);
108+
console.log("destinationFolderPath", destinationFolderPath);
106109

107110
if (!fs.existsSync(destinationFolderPath)) {
108111
fs.mkdirSync(destinationFolderPath, { recursive: true });
@@ -138,10 +141,8 @@ const copyMPKFiles = () => {
138141
files.forEach(file => {
139142
if (path.extname(file) === ".mpk") {
140143
const sourceFile = path.join(mpkFolderPath, file);
141-
const destinationFile = path.join(
142-
destinationFolderPath,
143-
widget.name + "_" + file
144-
);
144+
const destinationFile = path.join(destinationFolderPath, file);
145+
145146
fs.copyFileSync(sourceFile, destinationFile);
146147
log.success(
147148
`Copied '${widget.name}/${file}' to 'dist/pluggableWidgets'`

0 commit comments

Comments
 (0)