From f006b2bde4b028ef02dde2e9b5bb60773af1ff79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n?= Date: Sat, 1 Jul 2017 09:13:37 +0200 Subject: [PATCH] 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 --- app.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index c890f8a38..d0fc0bfeb 100755 --- a/app.js +++ b/app.js @@ -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]);