From c2a1012fddb1d6c678e3d8f2e27735600fca9841 Mon Sep 17 00:00:00 2001 From: David Glasser Date: Mon, 25 Feb 2013 14:34:25 -0800 Subject: [PATCH] rename get_core_dir -> getEngineDir --- lib/files.js | 10 +++++----- lib/packages.js | 2 +- lib/run.js | 2 +- lib/tests/test_bundler_npm.js | 2 +- lib/update.js | 2 +- lib/warehouse.js | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/files.js b/lib/files.js index fb297f16b8..dccbff74cd 100644 --- a/lib/files.js +++ b/lib/files.js @@ -189,7 +189,7 @@ var files = module.exports = { // an installation.) in_checkout: function () { try { - if (fs.existsSync(path.join(files.get_core_dir(), '.git'))) + if (fs.existsSync(path.join(files.getEngineDir(), '.git'))) return true; } catch (e) { console.log(e);} @@ -199,7 +199,7 @@ var files = module.exports = { // Read the '.engine_version.txt' file. If in a checkout, throw an error. getEngineVersion: function () { if (!files.in_checkout()) { - return fs.readFileSync(path.join(files.get_core_dir(), '.engine_version.txt')); + return fs.readFileSync(path.join(files.getEngineDir(), '.engine_version.txt')); } else { throw new Error("Unexpected. Git checkouts don't have engine versions."); } @@ -209,13 +209,13 @@ var files = module.exports = { // install, or (checkout root)/dev_bundle in a checkout..) get_dev_bundle: function () { if (files.in_checkout()) - return path.join(files.get_core_dir(), 'dev_bundle'); + return path.join(files.getEngineDir(), 'dev_bundle'); else - return files.get_core_dir(); + return files.getEngineDir(); }, // Return the top-level directory for this meteor install or checkout - get_core_dir: function () { + getEngineDir: function () { return path.join(__dirname, '..'); }, diff --git a/lib/packages.js b/lib/packages.js index 1f30c4d4af..2d441965cf 100644 --- a/lib/packages.js +++ b/lib/packages.js @@ -408,7 +408,7 @@ var packages = module.exports = { _localPackageDirs: function () { var packageDirs = []; if (files.in_checkout()) - packageDirs.push(path.join(files.get_core_dir(), 'packages')); + packageDirs.push(path.join(files.getEngineDir(), 'packages')); if (process.env.PACKAGE_DIRS) packageDirs = process.env.PACKAGE_DIRS.split(':').concat(packageDirs); diff --git a/lib/run.js b/lib/run.js index 09adb49d10..c390384cf1 100644 --- a/lib/run.js +++ b/lib/run.js @@ -330,7 +330,7 @@ var DependencyWatcher = function (deps, app_dir, relativeFiles, on_change) { // contain individual files) self.bulk_dirs = []; _.each(deps.core || [], function (filepath) { - self.bulk_dirs.push(path.join(files.get_core_dir(), filepath)); + self.bulk_dirs.push(path.join(files.getEngineDir(), filepath)); }); _.each(deps.app || [], function (filepath) { self.bulk_dirs.push(path.join(self.app_dir, filepath)); diff --git a/lib/tests/test_bundler_npm.js b/lib/tests/test_bundler_npm.js index 7ec532a545..c9124a539d 100644 --- a/lib/tests/test_bundler_npm.js +++ b/lib/tests/test_bundler_npm.js @@ -244,7 +244,7 @@ assert.doesNotThrow(function () { // shared state, such as cached compiled packages try { var result = meteorNpm._execFileSync( - path.join(files.get_core_dir(), "meteor"), + path.join(files.getEngineDir(), "meteor"), ["bundle", path.join(tmpDirToPutBundleTarball, "bundle.tar.gz")], {cwd: tmpAppDir}); files.rm_recursive(tmpDirToPutBundleTarball); diff --git a/lib/update.js b/lib/update.js index cac1916ea4..74ecf03dba 100644 --- a/lib/update.js +++ b/lib/update.js @@ -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'); + var postup_path = path.join(files.getEngineDir(), 'meteor', 'post-upgrade.js'); if (fs.existsSync(nodejs_path) && fs.existsSync(postup_path)) { // setup environment. diff --git a/lib/warehouse.js b/lib/warehouse.js index c3e2ca962c..51bfd80f83 100644 --- a/lib/warehouse.js +++ b/lib/warehouse.js @@ -37,7 +37,7 @@ var warehouse = module.exports = { return process.env.TEST_WAREHOUSE_DIR; if (files.in_checkout()) - return path.join(files.get_core_dir(), '.meteor'); + return path.join(files.getEngineDir(), '.meteor'); else return path.join(process.env.HOME, '.meteor'); },