Add an extra arg to disable remote fetching of compilers

If no fetching is desired if @ is found on a compiler's path,
passing --noFetchRemote as an extra arg will do exactly that.

The default behaviour is to allow fetchings.

Releated issue: #470
This commit is contained in:
Rubén
2017-07-01 09:13:37 +02:00
parent d6a026f3f7
commit f006b2bde4
+4 -1
View File
@@ -52,6 +52,7 @@ var opts = nopt({
'debug': [Boolean],
'static': [String],
'archivedVersions': [String],
'noRemoteFetch': [Boolean]
});
if (opts.debug) logger.level = 'debug';
@@ -66,6 +67,8 @@ var staticDir = opts.static || 'static';
var archivedVersions = opts.archivedVersions;
var gitReleaseName = child_process.execSync('git rev-parse HEAD').toString().trim();
var versionedRootPrefix = "";
// Don't treat @ in paths as remote adresses
var fetchCompilersFromRemote = !opts.noRemoteFetch;
if (opts.static && fs.existsSync(opts.static + '/v/' + gitReleaseName))
versionedRootPrefix = "v/" + gitReleaseName + "/";
@@ -366,7 +369,7 @@ function findCompilers() {
}
function recurseGetCompilers(name, parentProps) {
if (name.indexOf("@") !== -1) {
if (fetchCompilersFromRemote && name.indexOf("@") !== -1) {
var bits = name.split("@");
var host = bits[0];
var port = parseInt(bits[1]);