From 6ecd63bef0285144ff2c887397ad62046a38b3ad Mon Sep 17 00:00:00 2001 From: Matt Godbolt Date: Sun, 15 Jan 2017 16:29:01 -0600 Subject: [PATCH] Banner fixes --- etc/config/c++.amazon.properties | 2 ++ etc/config/c++.danger.properties | 1 + etc/config/d.amazon.properties | 1 + etc/config/go.amazon.properties | 1 + etc/config/rust.amazon.properties | 1 + lib/compile-handler.js | 3 ++- 6 files changed, 8 insertions(+), 1 deletion(-) diff --git a/etc/config/c++.amazon.properties b/etc/config/c++.amazon.properties index 5d7ced6a..5b398b6d 100644 --- a/etc/config/c++.amazon.properties +++ b/etc/config/c++.amazon.properties @@ -1,5 +1,7 @@ compilers=gcc1204@20480:&gcc86:&icc:&clang:&cl:&cross:&ellcc defaultCompiler=g63 +textBanner=Compilation provided by Compiler Explorer at https://gcc.godbolt.org/ + ############################### # GCC for x86 group.gcc86.compilers=g471:g472:g473:g474:g481:g482:g483:g484:g485:g490:g491:g492:g493:g494:g510:g520:g530:g540:g6:g62:g63:g7snapshot diff --git a/etc/config/c++.danger.properties b/etc/config/c++.danger.properties index 5013c12b..40c858e0 100644 --- a/etc/config/c++.danger.properties +++ b/etc/config/c++.danger.properties @@ -1,5 +1,6 @@ # Matt's home development computer defaultCompiler=g54 +textBanner=Testing the text banner compilers=g54:g47:g48:avr #compilers=localhost@20480 compiler.g54.exe=/usr/bin/g++ diff --git a/etc/config/d.amazon.properties b/etc/config/d.amazon.properties index 486e4471..07fd3798 100644 --- a/etc/config/d.amazon.properties +++ b/etc/config/d.amazon.properties @@ -1,4 +1,5 @@ compilers=gdc48:gdc49:gdc52:&ldc +textBanner=Compilation provided by Compiler Explorer at https://d.godbolt.org/ defaultCompiler=gdc52 # This is only due to limitations on the d.godbolt.org image for now. supportsBinary=false diff --git a/etc/config/go.amazon.properties b/etc/config/go.amazon.properties index 68c2d7ca..0d753484 100644 --- a/etc/config/go.amazon.properties +++ b/etc/config/go.amazon.properties @@ -1,4 +1,5 @@ defaultCompiler=gccgo491 +textBanner=Compilation provided by Compiler Explorer at https://go.godbolt.org/ compilers=gccgo491:6g141 compileFilename=file.go compiler.gccgo491.exe=/usr/bin/gccgo diff --git a/etc/config/rust.amazon.properties b/etc/config/rust.amazon.properties index 7de85c1d..3c74a1dd 100644 --- a/etc/config/rust.amazon.properties +++ b/etc/config/rust.amazon.properties @@ -1,4 +1,5 @@ compilers=&rust +textBanner=Compilation provided by Compiler Explorer at https://rust.godbolt.org/ defaultCompiler=r1140 group.rust.compilers=r1140:r1130:r1120:r1110:r1100:r190:r180:r170:r160:r150:r140:r130:r120:r110:r100:nightly:beta group.rust.compilerType=rust diff --git a/lib/compile-handler.js b/lib/compile-handler.js index 46844f55..70f8e712 100644 --- a/lib/compile-handler.js +++ b/lib/compile-handler.js @@ -85,6 +85,7 @@ function CompileHandler(gccProps, compilerProps) { }); }; var proxy = httpProxy.createProxyServer({}); + var textBanner = compilerProps('textBanner'); this.handler = _.bind(function compile(req, res, next) { var source, options, filters, compiler; @@ -149,7 +150,7 @@ function CompileHandler(gccProps, compilerProps) { } else { res.set('Content-Type', 'text/plain'); try { - res.write("# Compilation provided by Compiler Explorer at " + req.get('Host') + "\n"); + if (!_.isEmpty(textBanner)) res.write('# ' + textBanner + "\n"); res.write(textify(result.asm)); if (result.code !== 0) res.write("\n# Compiler exited with result code " + result.code); if (!_.isEmpty(result.stdout)) res.write("\nStandard out:\n" + textify(result.stdout));