Skip to content

Commit

Permalink
Safe mode "--safe" changed to not case-sensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy351 committed Dec 15, 2012
1 parent 518cf96 commit b1ff0dd
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions bin/hexo
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
#!/usr/bin/env node

var args = process.argv.slice(2),
safe = args.indexOf('--safe');
argss = args.join(' '),
regex = /--safe/i,
safe = argss.match(regex);

if (safe !== -1) args.splice(safe, 1);
if (safe){
args = argss.replace(regex, '').split(' ');

for (var i=0; i<args.length; i++){
if (!args[i]) args.splice(i, 1);
}
}

var command = args.length ? args.shift().toLowerCase() : '';

Expand Down

0 comments on commit b1ff0dd

Please sign in to comment.