cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "George Campbell (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-13614) Asset tag create only works if file is targeted to root directory
Date Thu, 30 Nov 2017 14:22:00 GMT

    [ https://issues.apache.org/jira/browse/CB-13614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16272717#comment-16272717
] 

George Campbell commented on CB-13614:
--------------------------------------

I don't have permission to push up a branch for a pull request, but this is my proposed solution:

{{/bin/template/cordova/browser_handler.js}}

starting at line 115

{noformat}
    asset: {
        install: function (asset, plugin_dir, wwwDest) {
            var src = path.join(plugin_dir, asset.src);
            var dest = path.join(wwwDest, asset.target);

            if (fs.statSync(src).isDirectory()) {
                shell.cp('-Rf', src + '/*', dest);
            } else {
                // Only change is to add this line to create the directory path if it does
not already exist
                shell.mkdir(path.parse(dest).dir);
                shell.cp('-f', src, dest);
            }
        },
        uninstall: function (asset, wwwDest, plugin_id) {
            shell.rm('-rf', path.join(wwwDest, asset.target));
            shell.rm('-rf', path.join(wwwDest, 'plugins', plugin_id));
        }
    }
};
{noformat}

> Asset tag create only works if file is targeted to root directory
> -----------------------------------------------------------------
>
>                 Key: CB-13614
>                 URL: https://issues.apache.org/jira/browse/CB-13614
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-browser
>    Affects Versions: 5.0.1
>            Reporter: George Campbell
>            Assignee: Jesse MacFadyen
>
> Inside a plugin.xml file, 
> <asset src="www/style/inappbrowser.css" target="style/inappbrowser.css"/>
> results in:
> cp: copyFileSync: could not write to dest file (code=ENOENT):/Users/campbelg/IdeaProjects/wms-circ-app/platforms/browser/platform_www/style/inappbrowser.css
> Related to CB-13562, which fixed the case of an asset file whose target was the root
directory. This bug is for assets whose target contains a directory.
> The expected behavior is described by the plugin.xml documentation:
> https://cordova.apache.org/docs/en/latest/plugin_ref/spec.html#asset



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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


Mime
View raw message