bugfix for path.join

This commit is contained in:
OttoMao 2015-03-19 11:48:05 +08:00
parent ce454e6ad4
commit aafdb62193

3
bin.js
View File

@ -46,12 +46,13 @@ if(program.clear){
var ruleModule; var ruleModule;
if(program.rule){ if(program.rule){
var ruleFilePath = path.join(process.cwd(),program.rule); var ruleFilePath = path.resolve(process.cwd(),program.rule);
try{ try{
if(fs.existsSync(ruleFilePath)){ if(fs.existsSync(ruleFilePath)){
ruleModule = require(ruleFilePath); ruleModule = require(ruleFilePath);
console.log("rule file loaded :" + ruleFilePath); console.log("rule file loaded :" + ruleFilePath);
}else{ }else{
console.log(ruleFilePath);
console.log(color.red("can not find rule file")); console.log(color.red("can not find rule file"));
} }
}catch(e){ }catch(e){