MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / ensureCordovaFiles

Function ensureCordovaFiles

utils/scripts/dev.js:258–277  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

256// ─── cordova helpers ─────────────────────────────────────────────────────────
257
258function ensureCordovaFiles() {
259 // Copy cordova.js and any other platform_www files into www/
260 // so the dev server can serve them when the app redirects to it.
261 if (!fs.existsSync(PLATFORM_WWW)) {
262 log("warn", "platform_www not found — skipping cordova file copy");
263 return;
264 }
265
266 const files = fs.readdirSync(PLATFORM_WWW);
267 for (const file of files) {
268 const src = path.join(PLATFORM_WWW, file);
269 const dest = path.join(WWW, file);
270 if (fs.statSync(src).isFile()) {
271 // Don't overwrite index.html
272 if (file === "index.html") continue;
273 fs.copyFileSync(src, dest);
274 }
275 }
276 log("ok", "Copied cordova platform files to www/");
277}
278
279async function launchApp(target, platform, emulator) {
280 if (target) {

Callers 1

mainFunction · 0.85

Calls 1

logFunction · 0.70

Tested by

no test coverage detected