Skip to content

Loading…

Hi! I fixed some code for you! #5

Open
wants to merge 3 commits into from

2 participants

@node-migrator-bot

Hi!

I am migrationBot

Did you know that path.{exists,existsSync} was moved to fs.{exists,existsSync}, and that tty.setRawMode(mode) was moved to tty.ReadStream#setRawMode() (i.e. process.stdin.setRawMode()) in node v0.8.0? Read more @API changes between v0.6 and v0.8

I automatically made some changes I think will help you migrate your codebase to node v0.8.0, please review these changes and merge them if you feel they are useful, If they are not you can ignore this Pull Request.

For backwards compatibility please use something like fs.existsSync || (fs.existsSync = path.existsSync);, fs.exists || (fs.exists = path.exists);, and tty.setRawMode || (tty.setRawMode = process.stdin.setRawMode); respectively.

Have a Nice Day!

--migrationBot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Showing with 5 additions and 5 deletions.
  1. +2 −2 bin/cmd.js
  2. +2 −2 lib/config.js
  3. +1 −1 lib/git_dir.js
View
4 bin/cmd.js
@@ -37,8 +37,8 @@ withConfig(function (config) {
}
else {
var dir = gitDir(process.cwd());
- if (!path.existsSync(dir + '/.travis.yml')
- && path.existsSync(dir + '/package.json')) {
+ if (!fs.existsSync(dir + '/.travis.yml')
+ && fs.existsSync(dir + '/package.json')) {
var pkg = JSON.parse(fs.readFileSync(dir + '/package.json'));
var sv = (pkg.engines || {}).node || '>=0.4';
View
4 lib/config.js
@@ -4,7 +4,7 @@ var mkdirp = require('mkdirp');
var tty = require('tty');
function echo (mode) {
- tty.setRawMode(!mode);
+ process.stdin.setRawMode(!mode);
}
module.exports = function (cb) {
@@ -20,7 +20,7 @@ module.exports = function (cb) {
})
}
- path.exists(file, function (ex) {
+ fs.exists(file, function (ex) {
if (!ex) prompt(function (vars) {
fs.writeFile(file, JSON.stringify(vars), function (err) {
if (err) console.error(err)
View
2 lib/git_dir.js
@@ -4,6 +4,6 @@ module.exports = function (dir) {
var ps = dir.split('/');
for (var i = ps.length; i > 0; i--) {
var p = ps.slice(0, i).join('/');
- if (path.existsSync(p + '/.git')) return p;
+ if (fs.existsSync(p + '/.git')) return p;
}
};
Something went wrong with that request. Please try again.