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

Paths should be relative to working directory #8

Open
jamesarosen opened this issue Mar 26, 2013 · 2 comments
Open

Paths should be relative to working directory #8

jamesarosen opened this issue Mar 26, 2013 · 2 comments

Comments

@jamesarosen
Copy link

What Happened?

I've installed gluejs locally:

"devDependencies": {
  "gluejs": "~0.2.0"
}

Then I ran the following in node (with /my_project/ as the working directory):

new Glue()
  .basepath('./src')
  .include('./src')
  .replace({ jquery: 'window.jQuery' })
  .export('MyLibrary')
  .render(function (err, txt) {
    fs.writeFile('./assets/insistent_cat.js', txt);
  });

I get the following error:

Error: ENOENT, no such file or directory '/my_project/node_modules/gluejs/lib/src'
    at Object.fs.statSync (fs.js:524:18)
    at Group.include (/my_project/node_modules/gluejs/lib/group.js:21:26)
    at Array.forEach (native)
    at Group.include (/my_project/node_modules/gluejs/lib/group.js:19:9)
    at Renderer.include (/my_project/node_modules/gluejs/lib/glue.js:42:55)
    at repl:1:30
    at REPLServer.self.eval (repl.js:111:21)
    at rli.on.e (repl.js:260:20)
    at REPLServer.self.eval (repl.js:118:5)
    at Interface.<anonymous> (repl.js:250:12)

What Did You Expect?

I expected .basepath('./src'), .include('./src'), and fs.writeFile('./assets/insistent_cat.js', txt); all to be relative to the current working directory.

@jbeard4
Copy link

jbeard4 commented Apr 1, 2013

I just hit this today. +1

@moll
Copy link

moll commented Nov 22, 2013

I'd also say local paths should have ./ prepended to them to distinguish them from modules in node_modules.

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

3 participants