mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
@@ -1,6 +1,15 @@
|
||||
if (process.env.ROOT_URL &&
|
||||
typeof __meteor_runtime_config__ === "object") {
|
||||
__meteor_runtime_config__.ROOT_URL = process.env.ROOT_URL;
|
||||
var pathPrefix = Npm.require('url').parse(__meteor_runtime_config__.ROOT_URL).pathname;
|
||||
__meteor_runtime_config__.ROOT_URL_PATH_PREFIX = pathPrefix === "/" ? "" : pathPrefix;
|
||||
if (__meteor_runtime_config__.ROOT_URL) {
|
||||
var parsedUrl = Npm.require('url').parse(__meteor_runtime_config__.ROOT_URL);
|
||||
// Sometimes users try to pass, eg, ROOT_URL=mydomain.com.
|
||||
if (!parsedUrl.host) {
|
||||
throw Error("$ROOT_URL, if specified, must be an URL");
|
||||
}
|
||||
var pathPrefix = parsedUrl.pathname;
|
||||
__meteor_runtime_config__.ROOT_URL_PATH_PREFIX = pathPrefix === "/" ? "" : pathPrefix;
|
||||
} else {
|
||||
__meteor_runtime_config__.ROOT_URL_PATH_PREFIX = "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -337,6 +337,17 @@ Fiber(function () {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// This is a bit of a hack, but: if we don't check this in the tool, then the
|
||||
// first time we do a unipackage.load, it will fail due to the check in the
|
||||
// meteor package, and that'll look a lot uglier.
|
||||
if (process.env.ROOT_URL) {
|
||||
var parsedUrl = require('url').parse(process.env.ROOT_URL);
|
||||
if (!parsedUrl.host) {
|
||||
process.stderr.write('$ROOT_URL, if specified, must be an URL.\n');
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
// Parse the arguments.
|
||||
//
|
||||
// We must first identify which options are boolean and which take
|
||||
|
||||
Reference in New Issue
Block a user