mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-11-30 22:41:19 -06:00
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:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user