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

Windows file tasks with drive letter break #318

Open
markandrus opened this issue May 24, 2016 · 5 comments
Open

Windows file tasks with drive letter break #318

markandrus opened this issue May 24, 2016 · 5 comments

Comments

@markandrus
Copy link

Hi!

If you create a file task that includes a drive letter, for example

file('C:\foo', function() {
  // Do something
});

task('bar', ['C:\foo']);

then trying to run bar will fail. I discovered this after writing a bunch of platform-independent code using path.resolve, only to find it failed on Windows.

This issue is related to #252, but I think it might warrant a separate ticket since the issue seems more serious than if ":" were simply disallowed in tasks.

Thanks,
Mark

@markandrus
Copy link
Author

markandrus commented May 24, 2016

I think the issue has to do with the way we split on ":" here.

@welearnednothing
Copy link
Contributor

Thanks Mark! For completeness, can you include a sample error as well?

On May 23, 2016, at 20:30, Mark Roberts [email protected] wrote:

Hi!

If you create a file task that includes a drive letter, for example

file('C:\foo', function() {
// Do something
});

task('bar', ['C:\foo']);
then trying to run bar will fail. I discovered this after writing a bunch of platform-independent code using path.resolve, only to find it failed on Windows.

This issue is related to #252, but I think it might warrant a separate ticket since the issue seems more serious than if ":" were simply disallowed in tasks.

Thanks,
Mark


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub

@markandrus
Copy link
Author

markandrus commented May 24, 2016

@welearnednothing sure thing. Here's a sample Jakefile

var fs = require('fs');
var path = require('path');

var foo = path.join(__dirname, 'foo');

file(foo, function() {
  fs.closeSync(fs.openSync(foo, 'w'));
});

task('bar', [foo]);

When I run it on Windows, I get

C:\Users\mrobe\test-jake>jake bar
jake aborted.
Error: Unknown task "C:\Users\mrobe\test-jake\foo"
    at TaskBase.nextPrereq (C:\Users\mrobe\test-jake\node_modules\jake\lib\task\task.js:181:15)
    at TaskBase.runPrereqs (C:\Users\mrobe\test-jake\node_modules\jake\lib\task\task.js:155:14)
(See full trace by running task with --trace)

whereas on OS X it works fine.

@mde
Copy link
Contributor

mde commented May 24, 2016

@markandrus I've added you to the org -- use your commit-bit powers for good!

@yosheeck
Copy link

Causing trouble also for me/us on Windows machines. Just saying it will be useful to have a fix.

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

4 participants