You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by carynbear <gi...@git.apache.org> on 2016/06/14 00:04:14 UTC

[GitHub] cordova-lib pull request #456: CB-11412 improve template implementation

GitHub user carynbear opened a pull request:

    https://github.com/apache/cordova-lib/pull/456

    CB-11412 improve template implementation

    Removed symlinking.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/carynbear/cordova-lib CB-11412-remove-linking

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-lib/pull/456.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #456
    
----
commit 5139dee43071c518b9336f69df468824be0c496f
Author: carynbear <ca...@berkeley.edu>
Date:   2016-06-13T21:29:06Z

    CB-11412 improve template implementation

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-lib issue #456: CB-11412 improve template implementation

Posted by stevengill <gi...@git.apache.org>.
Github user stevengill commented on the issue:

    https://github.com/apache/cordova-lib/pull/456
  
    LGTM!



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-lib pull request #456: CB-11412 improve template implementation

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cordova-lib/pull/456


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-lib pull request #456: CB-11412 improve template implementation

Posted by stevengill <gi...@git.apache.org>.
Github user stevengill commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/456#discussion_r67077184
  
    --- Diff: cordova-lib/src/cordova/create.js ---
    @@ -252,133 +249,116 @@ function create(dir, optionalId, optionalName, cfg, fetchOpt) {
                 www: import_from_path
             };
     
    -        // Keep going into child "www" folder if exists in stock app package.
    +        // Keep going into child "www" folder if exists in stock app package; used to find config.xml
             while (fs.existsSync(path.join(paths.www, 'www'))) {
                 paths.root = paths.www;
                 paths.www = path.join(paths.root, 'www');
             }
     
    -        // find config.xml
    +        // find config.xml OR get stock config.xml, used if template does not contain config.xml
             if (fs.existsSync(path.join(paths.root, 'config.xml'))) {
                 paths.configXml = path.join(paths.root, 'config.xml');
    -            paths.configXmlLinkable = true;
             } else {
    -            try {
    -                paths.configXml =
    -                    path.join(require('cordova-app-hello-world').dirname,
    -                        'config.xml');
    -            } catch (e) {
    -                // Falling back on npm@2 path hierarchy
    -                // TODO: Remove fallback after cordova-app-hello-world release
    -                paths.configXml =
    -                    path.join(__dirname, '..', '..', 'node_modules',
    -                        'cordova-app-hello-world', 'config.xml');
    -            }
    -        }
    -        if (fs.existsSync(path.join(paths.root, 'merges'))) {
    -            paths.merges = path.join(paths.root, 'merges');
    -        } else {
    -            // No merges by default
    -        }
    -        if (fs.existsSync(path.join(paths.root, 'hooks'))) {
    -            paths.hooks = path.join(paths.root, 'hooks');
    -            paths.hooksLinkable = true;
    -        } else {
    -            try {
    -                paths.hooks =
    -                    path.join(require('cordova-app-hello-world').dirname,
    -                        'hooks');
    -            } catch (e) {
    -                // Falling back on npm@2 path hierarchy
    -                // TODO: Remove fallback after cordova-app-hello-world release
    -                paths.hooks =
    -                    path.join(__dirname, '..', '..', 'node_modules',
    -                        'cordova-app-hello-world', 'hooks');
    -            }
    +            paths.configXml = path.join(require('cordova-app-hello-world').dirname, 'config.xml');
             }
     
    +        // get stock www; used if template does not contain www
    +        paths.www = path.join(require('cordova-app-hello-world').dirname, 'www');
    +
    +        // get stock hooks; used if template does not contain hooks
    +        paths.hooks = path.join(require('cordova-app-hello-world').dirname, 'hooks');
    +    
    +
             var dirAlreadyExisted = fs.existsSync(dir);
             if (!dirAlreadyExisted) {
                 fs.mkdirSync(dir);
             }
     
    -
    -        var tryToLink = !!cfg.lib.www.link;
    -        function copyOrLink(src, dst, linkable) {
    -            if (src) {
    -                if (tryToLink && linkable) {
    -                    fs.symlinkSync(src, dst, 'dir');
    -                } else {
    -                    shell.mkdir(dst);
    -                    shell.cp('-R', path.join(src, '*'), dst);
    -                }
    -            }
    -        }
    -
    -        /*
    -        Copies template files, and directories into a Cordova project directory.
    -        Files, and directories not copied include: www, mergers,platforms,
    -        plugins, hooks, and config.xml. A template directory, and platform
    -        directory must be passed.
    -
    -        templateDir - Template directory
    -        projectDir - Project directory
    -         */
    -        function copyTemplateFiles(templateDir, projectDir) {
    -            var templateFiles;		// Current file
    -
    -            templateFiles = fs.readdirSync(templateDir);
    -
    -            // Remove directories, and files that are automatically copied
    -            templateFiles = templateFiles.filter(
    -                function (value) {
    -                    return !(value === 'www' || value === 'mergers' ||
    -                    value === 'config.xml' || value === 'hooks');
    -                }
    -            );
    -
    -            // Copy each template file
    -            for (var i = 0; i < templateFiles.length; i++)
    -                shell.cp('-R', path.resolve(templateDir, templateFiles[i]), projectDir);
    -        }
    -
             try {
    -            copyOrLink(paths.www, path.join(dir, 'www'), true);
    -            copyOrLink(paths.merges, path.join(dir, 'merges'), true);
    -            copyOrLink(paths.hooks, path.join(dir, 'hooks'),
    -                paths.hooksLinkable);
    -
    +            // Copy files from template to project
                 if (cfg.lib.www.template)
    -                copyTemplateFiles(import_from_path, dir);
    +                copyTemplateFiles(import_from_path, dir, isSubDir);
     
    -            if (paths.configXml) {
    -                if (tryToLink && paths.configXmlLinkable) {
    -                    fs.symlinkSync(paths.configXml, path.join(dir, 'config.xml'));
    -                } else {
    -                    shell.cp(paths.configXml, path.join(dir, 'config.xml'));
    -                }
    +            // If following were not copied from template, copy from stock app hello world
    +            ifNotCopied(paths.www, path.join(dir, 'www'));
    +            ifNotCopied(paths.hooks, path.join(dir, 'hooks'));
    +            if (!fs.existsSync(path.join(dir, 'config.xml')) && paths.configXml) {
    +                shell.cp(paths.configXml, path.join(dir, 'config.xml'));
                 }
             } catch (e) {
                 if (!dirAlreadyExisted) {
                     shell.rm('-rf', dir);
                 }
    -            if (process.platform.slice(0, 3) == 'win' && e.code == 'EPERM')  {
    -                throw new CordovaError('Symlinks on Windows require Administrator privileges');
    -            }
                 throw e;
             }
    +
    +        // Update package.json name and version fields.
    +        if (fs.existsSync(path.join(dir, 'package.json'))) {
    +            var pkgjson = require(path.resolve(dir, 'package.json'));
    +            if (cfg.name) {
    +                pkgjson.name = cfg.name.toLowerCase();
    +            }
    +            pkgjson.version = '1.0.0';
    +            fs.writeFile(path.join(dir, 'package.json'), JSON.stringify(pkgjson), function (err) {
    +                if (err) throw new CordovaError('Could not write package.json');
    +                events.emit('verbose', 'writing name to package.json');
    +            });
    +        }
    +
             // Create basic project structure.
             if (!fs.existsSync(path.join(dir, 'platforms')))
                 shell.mkdir(path.join(dir, 'platforms'));
     
             if (!fs.existsSync(path.join(dir, 'plugins')))
                 shell.mkdir(path.join(dir, 'plugins'));
     
    -        // Write out id and name to config.xml
    +        // Write out id and name to config.xml; set version to 1.0.0 (to match package.json default version)
             var configPath = cordova_util.projectConfig(dir);
             var conf = new ConfigParser(configPath);
             if (cfg.id) conf.setPackageName(cfg.id);
             if (cfg.name) conf.setName(cfg.name);
    +        conf.setVersion('1.0.0');
             conf.write();
         });
     }
    +
    +/**
    + * Recursively copies folder to destination if folder is not found in destination.
    + * @param  {string} src for copying
    + * @param  {string} dst for copying
    + * @return No return value
    + */
    +function ifNotCopied(src, dst) {
    +    if (!fs.existsSync(dst) && src) {
    +        shell.mkdir(dst);
    +        shell.cp('-R', path.join(src, '*'), dst);
    +    }
    +}
    +
    +/**
    + * Copies template files, and directories into a Cordova project directory.
    + * If the template exists in a subdirectory everything is copied. 
    + * Otherwise package.json, RELEASENOTES.md, .git, NOTICE, LICENSE, COPYRIGHT, and .npmignore are not copied over.
    + * A template directory, and platform directory must be passed.
    --- End diff --
    
    I think you meant project directory not platform directory in this comment


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-lib pull request #456: CB-11412 improve template implementation

Posted by carynbear <gi...@git.apache.org>.
GitHub user carynbear reopened a pull request:

    https://github.com/apache/cordova-lib/pull/456

    CB-11412 improve template implementation

    Removed symlinking.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/carynbear/cordova-lib CB-11412-remove-linking

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-lib/pull/456.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #456
    
----
commit 5139dee43071c518b9336f69df468824be0c496f
Author: carynbear <ca...@berkeley.edu>
Date:   2016-06-13T21:29:06Z

    CB-11412 improve template implementation

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-lib pull request #456: CB-11412 improve template implementation

Posted by stevengill <gi...@git.apache.org>.
Github user stevengill commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/456#discussion_r67084182
  
    --- Diff: cordova-lib/src/cordova/create.js ---
    @@ -252,133 +249,116 @@ function create(dir, optionalId, optionalName, cfg, fetchOpt) {
                 www: import_from_path
             };
     
    -        // Keep going into child "www" folder if exists in stock app package.
    +        // Keep going into child "www" folder if exists in stock app package; used to find config.xml
             while (fs.existsSync(path.join(paths.www, 'www'))) {
                 paths.root = paths.www;
                 paths.www = path.join(paths.root, 'www');
             }
     
    -        // find config.xml
    +        // find config.xml OR get stock config.xml, used if template does not contain config.xml
             if (fs.existsSync(path.join(paths.root, 'config.xml'))) {
                 paths.configXml = path.join(paths.root, 'config.xml');
    -            paths.configXmlLinkable = true;
             } else {
    -            try {
    -                paths.configXml =
    -                    path.join(require('cordova-app-hello-world').dirname,
    -                        'config.xml');
    -            } catch (e) {
    -                // Falling back on npm@2 path hierarchy
    -                // TODO: Remove fallback after cordova-app-hello-world release
    -                paths.configXml =
    -                    path.join(__dirname, '..', '..', 'node_modules',
    -                        'cordova-app-hello-world', 'config.xml');
    -            }
    -        }
    -        if (fs.existsSync(path.join(paths.root, 'merges'))) {
    -            paths.merges = path.join(paths.root, 'merges');
    -        } else {
    -            // No merges by default
    -        }
    -        if (fs.existsSync(path.join(paths.root, 'hooks'))) {
    -            paths.hooks = path.join(paths.root, 'hooks');
    -            paths.hooksLinkable = true;
    -        } else {
    -            try {
    -                paths.hooks =
    -                    path.join(require('cordova-app-hello-world').dirname,
    -                        'hooks');
    -            } catch (e) {
    -                // Falling back on npm@2 path hierarchy
    -                // TODO: Remove fallback after cordova-app-hello-world release
    -                paths.hooks =
    -                    path.join(__dirname, '..', '..', 'node_modules',
    -                        'cordova-app-hello-world', 'hooks');
    -            }
    +            paths.configXml = path.join(require('cordova-app-hello-world').dirname, 'config.xml');
             }
     
    +        // get stock www; used if template does not contain www
    +        paths.www = path.join(require('cordova-app-hello-world').dirname, 'www');
    +
    +        // get stock hooks; used if template does not contain hooks
    +        paths.hooks = path.join(require('cordova-app-hello-world').dirname, 'hooks');
    +    
    +
             var dirAlreadyExisted = fs.existsSync(dir);
             if (!dirAlreadyExisted) {
                 fs.mkdirSync(dir);
             }
     
    -
    -        var tryToLink = !!cfg.lib.www.link;
    -        function copyOrLink(src, dst, linkable) {
    -            if (src) {
    -                if (tryToLink && linkable) {
    -                    fs.symlinkSync(src, dst, 'dir');
    -                } else {
    -                    shell.mkdir(dst);
    -                    shell.cp('-R', path.join(src, '*'), dst);
    -                }
    -            }
    -        }
    -
    -        /*
    -        Copies template files, and directories into a Cordova project directory.
    -        Files, and directories not copied include: www, mergers,platforms,
    -        plugins, hooks, and config.xml. A template directory, and platform
    -        directory must be passed.
    -
    -        templateDir - Template directory
    -        projectDir - Project directory
    -         */
    -        function copyTemplateFiles(templateDir, projectDir) {
    -            var templateFiles;		// Current file
    -
    -            templateFiles = fs.readdirSync(templateDir);
    -
    -            // Remove directories, and files that are automatically copied
    -            templateFiles = templateFiles.filter(
    -                function (value) {
    -                    return !(value === 'www' || value === 'mergers' ||
    -                    value === 'config.xml' || value === 'hooks');
    -                }
    -            );
    -
    -            // Copy each template file
    -            for (var i = 0; i < templateFiles.length; i++)
    -                shell.cp('-R', path.resolve(templateDir, templateFiles[i]), projectDir);
    -        }
    -
             try {
    -            copyOrLink(paths.www, path.join(dir, 'www'), true);
    -            copyOrLink(paths.merges, path.join(dir, 'merges'), true);
    -            copyOrLink(paths.hooks, path.join(dir, 'hooks'),
    -                paths.hooksLinkable);
    -
    +            // Copy files from template to project
                 if (cfg.lib.www.template)
    -                copyTemplateFiles(import_from_path, dir);
    +                copyTemplateFiles(import_from_path, dir, isSubDir);
     
    -            if (paths.configXml) {
    -                if (tryToLink && paths.configXmlLinkable) {
    -                    fs.symlinkSync(paths.configXml, path.join(dir, 'config.xml'));
    -                } else {
    -                    shell.cp(paths.configXml, path.join(dir, 'config.xml'));
    -                }
    +            // If following were not copied from template, copy from stock app hello world
    +            ifNotCopied(paths.www, path.join(dir, 'www'));
    +            ifNotCopied(paths.hooks, path.join(dir, 'hooks'));
    +            if (!fs.existsSync(path.join(dir, 'config.xml')) && paths.configXml) {
    +                shell.cp(paths.configXml, path.join(dir, 'config.xml'));
                 }
             } catch (e) {
                 if (!dirAlreadyExisted) {
                     shell.rm('-rf', dir);
                 }
    -            if (process.platform.slice(0, 3) == 'win' && e.code == 'EPERM')  {
    -                throw new CordovaError('Symlinks on Windows require Administrator privileges');
    -            }
                 throw e;
             }
    +
    +        // Update package.json name and version fields.
    +        if (fs.existsSync(path.join(dir, 'package.json'))) {
    +            var pkgjson = require(path.resolve(dir, 'package.json'));
    +            if (cfg.name) {
    +                pkgjson.name = cfg.name.toLowerCase();
    +            }
    +            pkgjson.version = '1.0.0';
    +            fs.writeFile(path.join(dir, 'package.json'), JSON.stringify(pkgjson), function (err) {
    --- End diff --
    
    Lets maybe do the write operation as Sync and lets add spaces to the new package.json file. See https://github.com/apache/cordova-lib/blob/9f630271d9c02824c0031ea4cdc0e4955b53d9e2/cordova-lib/src/plugman/registry/manifest.js#L101


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-lib pull request #456: CB-11412 improve template implementation

Posted by carynbear <gi...@git.apache.org>.
Github user carynbear closed the pull request at:

    https://github.com/apache/cordova-lib/pull/456


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-lib pull request #456: CB-11412 improve template implementation

Posted by stevengill <gi...@git.apache.org>.
Github user stevengill commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/456#discussion_r67070160
  
    --- Diff: cordova-lib/spec-cordova/create.spec.js ---
    @@ -38,15 +37,17 @@ var configNormal = {
               version: 'testCordovaCreate'
             }
           }
    -    };
    -var configSymlink = {
    -      lib: {
    -        www: {
    -          url: path.join(__dirname, 'fixtures', 'base'), // "create" should copy or link the www child of this dir and not the dir itself.
    -          link: true
    -        }
    -      }
    -    };
    +};
    +
    +var configSubDirPkgJson = {
    +            lib: {
    --- End diff --
    
    nitpick: Look like lib obj here has an extra tab


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-lib pull request #456: CB-11412 improve template implementation

Posted by carynbear <gi...@git.apache.org>.
Github user carynbear commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/456#discussion_r67077463
  
    --- Diff: cordova-lib/spec-cordova/fixtures/templates/withsubdirectory_package_json/template/blah.txt ---
    @@ -0,0 +1 @@
    +blah
    --- End diff --
    
    no


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-lib pull request #456: CB-11412 improve template implementation

Posted by stevengill <gi...@git.apache.org>.
Github user stevengill commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/456#discussion_r67073107
  
    --- Diff: cordova-lib/spec-cordova/fixtures/templates/withsubdirectory_package_json/template/blah.txt ---
    @@ -0,0 +1 @@
    +blah
    --- End diff --
    
    Did you mean to include this file?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-lib pull request #456: CB-11412 improve template implementation

Posted by stevengill <gi...@git.apache.org>.
Github user stevengill commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/456#discussion_r67071311
  
    --- Diff: cordova-lib/spec-cordova/create.spec.js ---
    @@ -121,6 +122,36 @@ describe('create end-to-end', function() {
             // expect(configXml.name()).toEqual('TestBase');
         }
     
    +    function checkSubDir() {
    +        // Check if top level dirs exist.
    +        var dirs = ['hooks', 'platforms', 'plugins', 'www'];
    +        dirs.forEach(function(d) {
    +            expect(path.join(project, d)).toExist();
    +        });
    +        expect(path.join(project, 'hooks', 'README.md')).toExist();
    +        
    +        //index.js and template folder should not exist (inner files should be copied to the project folder)
    +        expect(path.join(project, 'index.js')).not.toExist();
    +        expect(path.join(project, 'template')).not.toExist();
    --- End diff --
    
    Is this assuming the template folder is named `template`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-lib issue #456: CB-11412 improve template implementation

Posted by carynbear <gi...@git.apache.org>.
Github user carynbear commented on the issue:

    https://github.com/apache/cordova-lib/pull/456
  
    @stevengill fixed up the little details


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-lib pull request #456: CB-11412 improve template implementation

Posted by carynbear <gi...@git.apache.org>.
Github user carynbear commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/456#discussion_r67077366
  
    --- Diff: cordova-lib/spec-cordova/create.spec.js ---
    @@ -121,6 +122,36 @@ describe('create end-to-end', function() {
             // expect(configXml.name()).toEqual('TestBase');
         }
     
    +    function checkSubDir() {
    +        // Check if top level dirs exist.
    +        var dirs = ['hooks', 'platforms', 'plugins', 'www'];
    +        dirs.forEach(function(d) {
    +            expect(path.join(project, d)).toExist();
    +        });
    +        expect(path.join(project, 'hooks', 'README.md')).toExist();
    +        
    +        //index.js and template folder should not exist (inner files should be copied to the project folder)
    +        expect(path.join(project, 'index.js')).not.toExist();
    +        expect(path.join(project, 'template')).not.toExist();
    --- End diff --
    
    correct


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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