You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ra...@apache.org on 2021/08/29 11:37:33 UTC

[cordova-serve] branch master updated: fix: pass mandatory args to platform API constructor (#44)

This is an automated email from the ASF dual-hosted git repository.

raphinesse pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-serve.git


The following commit(s) were added to refs/heads/master by this push:
     new 2607e5b  fix: pass mandatory args to platform API constructor (#44)
2607e5b is described below

commit 2607e5b543efe5651a4afbc59b99d90c19710edb
Author: seamlink-aalves <49...@users.noreply.github.com>
AuthorDate: Sun Aug 29 12:37:26 2021 +0100

    fix: pass mandatory args to platform API constructor (#44)
    
    Co-authored-by: Alexandre Alves <aa...@seamlink.com>
---
 src/util.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/util.js b/src/util.js
index 541e197..4393484 100644
--- a/src/util.js
+++ b/src/util.js
@@ -78,8 +78,9 @@ function getPlatformWwwRoot (cordovaProjectRoot, platformName) {
     }
 
     try {
-        const Api = require(path.join(cordovaProjectRoot, 'platforms', platformName, 'cordova/Api'));
-        return new Api().locations.www;
+        const platformRootFolder = path.join(cordovaProjectRoot, 'platforms', platformName);
+        const Api = require(path.join(platformRootFolder, 'cordova/Api'));
+        return new Api(platformName, platformRootFolder).locations.www;
     } catch (e) {
         // Fallback on hardcoded paths if platform api not found
         return path.join(cordovaProjectRoot, 'platforms', platformName, platform.www_dir);

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org