Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Hi! I fixed some code for you! #218

Closed
wants to merge 2 commits into from

3 participants

node-migrator-bot David Greenspan Joshua Holbrook
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.

Have a Nice Day!

--migrationBot

David Greenspan
Owner

Fixed on node-0.8 branch.

David Greenspan dgreensp closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 7, 2012
  1. Joshua Holbrook
  2. Joshua Holbrook

    [fix] tty.setRawMode(mode) was moved to tty.ReadStream#setRawMode() (…

    jfhbrook authored
    …i.e. process.stdin.setRawMode())
This page is out of date. Refresh to see the latest.
2  app/lib/bundler.js
View
@@ -508,7 +508,7 @@ _.extend(Bundle.prototype, {
// --- Static assets ---
if (is_app) {
- if (path.existsSync(path.join(project_dir, 'public'))) {
+ if (fs.existsSync(path.join(project_dir, 'public'))) {
files.cp_r(path.join(project_dir, 'public'),
path.join(build_path, 'static'), {ignore: ignore_files});
}
14 app/lib/files.js
View
@@ -98,7 +98,7 @@ var files = module.exports = {
// given a path, returns true if it is a meteor application (has a
// .meteor directory with a 'packages' file). false otherwise.
is_app_dir: function (filepath) {
- return path.existsSync(path.join(filepath, '.meteor/packages'));
+ return fs.existsSync(path.join(filepath, '.meteor/packages'));
},
// given a path, returns true if it is a meteor package (is a
@@ -106,7 +106,7 @@ var files = module.exports = {
//
// Note that a directory can be both a package _and_ an application.
is_package_dir: function (filepath) {
- return path.existsSync(path.join(filepath, 'package.js'));
+ return fs.existsSync(path.join(filepath, 'package.js'));
},
// given a path, return true if this is a collection of packages.
@@ -116,7 +116,7 @@ var files = module.exports = {
// is better than confusing the hell out of someone who names their
// project 'packages'
return path.basename(filepath) === 'packages' &&
- path.existsSync(path.join(filepath, 'meteor/package.js'));
+ fs.existsSync(path.join(filepath, 'meteor/package.js'));
},
// given a predicate function and a starting path, traverse upwards
@@ -154,7 +154,7 @@ var files = module.exports = {
// file, if the exact line does not already exist in the file.
add_to_gitignore: function (dir_path, entry) {
var filepath = path.join(dir_path, ".gitignore");
- if (path.existsSync(filepath)) {
+ if (fs.existsSync(filepath)) {
var data = fs.readFileSync(filepath, 'utf8');
var lines = data.split(/\n/);
if (_.any(lines, function (x) { return x === entry; })) {
@@ -175,7 +175,7 @@ var files = module.exports = {
// an installation.)
in_checkout: function () {
try {
- if (path.existsSync(path.join(__dirname, "../../.git")))
+ if (fs.existsSync(path.join(__dirname, "../../.git")))
return true;
} catch (e) { console.log(e);}
@@ -242,7 +242,7 @@ var files = module.exports = {
var p = path.resolve(dir);
var ps = path.normalize(p).split('/');
- if (path.existsSync(p)) {
+ if (fs.existsSync(p)) {
if (fs.statSync(p).isDirectory()) { return true;}
return false;
}
@@ -255,7 +255,7 @@ var files = module.exports = {
fs.mkdirSync(p, mode);
// double check we exist now
- if (!path.existsSync(p) ||
+ if (!fs.existsSync(p) ||
!fs.statSync(p).isDirectory())
return false; // wtf
return true;
2  app/lib/packages.js
View
@@ -269,7 +269,7 @@ var packages = module.exports = {
var dir = files.get_package_dir();
_.each(fs.readdirSync(dir), function (name) {
// skip .meteor directory
- if (path.existsSync(path.join(dir, name, 'package.js')))
+ if (fs.existsSync(path.join(dir, name, 'package.js')))
ret[name] = packages.get(name);
});
2  app/lib/updater.js
View
@@ -70,7 +70,7 @@ exports.git_sha = function () {
var d = files.get_dev_bundle();
var f = path.join(d, ".git_version.txt");
- if (path.existsSync(f)) {
+ if (fs.existsSync(f)) {
try {
var contents = fs.readFileSync(f, 'utf8');
contents = contents.replace(/\s+$/, "");
6 app/meteor/deploy.js
View
@@ -264,14 +264,14 @@ var read_password = function (callback) {
var buf = '';
process.stdin.resume();
- tty.setRawMode(true);
+ process.stdin.setRawMode(true);
// keypress
process.stdin.on('keypress', function(c, key){
if (key && 'enter' === key.name) {
console.log();
process.stdin.removeAllListeners('keypress');
- tty.setRawMode(false);
+ process.stdin.setRawMode(false);
// if they just hit enter, prompt again. let's not do this.
// This means empty password is a valid password.
@@ -291,7 +291,7 @@ var read_password = function (callback) {
if (key && key.ctrl && 'c' === key.name) {
console.log();
process.stdin.removeAllListeners('keypress');
- tty.setRawMode(false);
+ process.stdin.setRawMode(false);
process.kill(process.pid, 'SIGINT');
return;
2  app/meteor/meteor.js
View
@@ -176,7 +176,7 @@ Commands.push({
process.exit(1);
}
- if (path.existsSync(appname)) {
+ if (fs.existsSync(appname)) {
process.stderr.write(appname + ": Already exists\n");
process.exit(1);
}
8 app/meteor/update.js
View
@@ -53,7 +53,7 @@ updater.get_manifest(function (manifest) {
// Launch post-upgrade script
var nodejs_path = path.join(files.get_dev_bundle(), 'bin', 'node');
var postup_path = path.join(files.get_core_dir(), 'meteor', 'post-upgrade.js');
- if (path.existsSync(nodejs_path) && path.existsSync(postup_path)) {
+ if (fs.existsSync(nodejs_path) && fs.existsSync(postup_path)) {
var postup_proc = spawn(nodejs_path, [postup_path]);
postup_proc.stderr.setEncoding('utf8');
postup_proc.stderr.on('data', function (data) {
@@ -74,8 +74,8 @@ updater.get_manifest(function (manifest) {
if (0 === process.getuid()) {
// already root. just spawn the command.
return spawn(cmd, args);
- } else if (path.existsSync("/bin/sudo") ||
- path.existsSync("/usr/bin/sudo")) {
+ } else if (fs.existsSync("/bin/sudo") ||
+ fs.existsSync("/usr/bin/sudo")) {
// spawn a sudo
console.log("Since this system includes sudo, Meteor will request root privileges to");
console.log("install. You may be prompted for a password. If you prefer to not use");
@@ -185,7 +185,7 @@ updater.get_manifest(function (manifest) {
// untar complete. swap directories
var old_base_dir = base_dir.slice(0,-1) + ".old";
- if (path.existsSync(old_base_dir))
+ if (fs.existsSync(old_base_dir))
files.rm_recursive(old_base_dir); // rm -rf !!
fs.renameSync(base_dir, old_base_dir);
Something went wrong with that request. Please try again.