-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix custom comiler file (absolute path) support in windows system #2329
Conversation
@silentcloud thanks! |
var compiler = c.split(':') | ||
, ext = compiler[0] | ||
, mod = compiler[1]; | ||
var compiler = c.match(/([a-z.]+):(([A-Z]:)?\S*)+/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are several problems with this regular expression--instead, try c.split(':', 1)
. does that work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var str = 'js:C:\\Users\\fortest\\example\\compiler.js';
console.log(str.split(':', 1))
//['js']
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, it still splits, just doesn't return it. how about just:
var idx = c.indexOf(':');
var ext = c.slice(0, idx);
var mod = c.slice(idx + 1);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"slice" is better, I will update this PR
Looks good to me. |
@boneskull merge & publish a version ? |
@silentcloud not sure when the release will be but I can merge this. thanks again. |
mocha --compilers js:C:\User\fortest\demo\compiler.js
#2310