Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source files problem in 0.8.x #123

Open
thenanox opened this issue Sep 25, 2014 · 1 comment
Open

Source files problem in 0.8.x #123

thenanox opened this issue Sep 25, 2014 · 1 comment

Comments

@thenanox
Copy link
Contributor

Im having myself a problem with sources when they are not in grunt folder or inside. I didnt have this problem in <0.7.x because i just configured source files with absolutepaths and it worked fine.

With this folder structure:

  • my project
    • front
    • grunt-mydocular
      • node_modules
        • docular

When files are specified in configuration, documentation says: The best way of providing this is by setting this value to the return of grunt.file.expand

The problem is that docular will receive paths like::

../front/js/...

So when exporting docs into webappfolder, this code in generator.js might breaks the build:

        fse.ensureDirSync(baseFolder + '/sources/');
            for (var i = 0, l = docs.length; i < l; i++) {
                if (dosc[i].file) {
                    console.log("BASE",baseFolder + '/sources/');
                    console.log("FILE", docs[i].file);
                    fse.ensureFileSync(baseFolder + '/sources/' + docs[i].file);
                    fse.copySync(docs[i].file, baseFolder + '/sources/' + docs[i].file);
                }
            }

Because baseFolder + '/sources/' + docs[i].file will be something like webapp/sources/../front/js so at the end sources are copied into webapp/front/js

Everything works fine in this code when sources are in grunt folder because the files are not passed with ../ as preffix.

I thought in a workaround copying sources intro grunt folder before starting to work with them. However, if this is a unwanted functionality, id like what do you think as a possible solution or alternative.

@stephenliberty
Copy link
Contributor

I'll investigate. You should be able to give docular whatever paths you want, without having to do any special copying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants