diff --git a/.tool-versions b/.tool-versions index fd4ad919..4ff471eb 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,3 @@ ruby 2.7.6 java adoptopenjdk-17.0.10+7 +nodejs 20.10.0 diff --git a/plugin/withAndroidDrawables.js b/plugin/withAndroidDrawables.js index f680db98..5e2ea657 100644 --- a/plugin/withAndroidDrawables.js +++ b/plugin/withAndroidDrawables.js @@ -1,6 +1,6 @@ const { withDangerousMod } = require('@expo/config-plugins'); -const fs = require('fs'); -const path = require('path'); +const fs = require('node:fs'); +const path = require('node:path'); /** * This config plugin copies files from the specified paths, like the assets @@ -27,19 +27,19 @@ function withAndroidDrawables(config, { drawableFiles }) { } // Copy each drawable file to the drawable directory - drawableFiles.forEach((filePath) => { + for (const filePath of drawableFiles) { const sourcePath = path.resolve(config.modRequest.projectRoot, filePath); const fileName = path.basename(filePath); const destPath = path.join(drawableDir, fileName); if (!fs.existsSync(sourcePath)) { console.warn(`Warning: Drawable file not found: ${sourcePath}`); - return; + continue; } // Copy the file fs.copyFileSync(sourcePath, destPath); - }); + } return config; },