mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
don't get tripped up by package.js in app dirs
This commit is contained in:
@@ -27,15 +27,24 @@ process.stdout.write(
|
||||
};
|
||||
|
||||
var require_project = function (cmd, accept_package) {
|
||||
var project_dir = files.find_upwards(function (p) {
|
||||
return files.is_app_dir(p) ||
|
||||
files.is_package_dir(p) || files.is_package_collection_dir(p);
|
||||
});
|
||||
var app_dir = files.find_upwards(files.is_app_dir);
|
||||
if (app_dir)
|
||||
return app_dir;
|
||||
|
||||
if (!project_dir) {
|
||||
// This is where you end up if you type 'meteor' with no
|
||||
// args. Be gentle to the noobs..
|
||||
process.stdout.write(
|
||||
var package_dir = files.find_upwards(function (p) {
|
||||
return files.is_package_dir(p) || files.is_package_collection_dir(p);
|
||||
});
|
||||
if (package_dir) {
|
||||
if (accept_package)
|
||||
return package_dir;
|
||||
|
||||
process.stdout.write(cmd + ": Only works on applications, not packages\n");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// This is where you end up if you type 'meteor' with no
|
||||
// args. Be gentle to the noobs..
|
||||
process.stdout.write(
|
||||
cmd + ": You're not in a Meteor project directory.\n" +
|
||||
"\n" +
|
||||
"To create a new Meteor project:\n" +
|
||||
@@ -44,15 +53,7 @@ cmd + ": You're not in a Meteor project directory.\n" +
|
||||
" meteor create myapp\n" +
|
||||
"\n" +
|
||||
"For more help, see 'meteor --help'.\n");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (!accept_package && !files.is_app_dir(project_dir)) {
|
||||
process.stdout.write(cmd + ": Only works on applications, not packages\n");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
return project_dir;
|
||||
process.exit(1);
|
||||
};
|
||||
|
||||
// See if mongo is running already. If so, return the current port. If
|
||||
|
||||
Reference in New Issue
Block a user