Skip to content

Commit

Permalink
Attempt fixing bash frontend build for bash selection (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
camerondurham authored Dec 9, 2023
1 parent be0494e commit d0ba018
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
1 change: 0 additions & 1 deletion web-frontend/js/langs-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ function langRequest() {
return new Promise(function (resolve, reject) {
let xhr = new XMLHttpRequest();
const fullUrl = runnerConfig.url + runnerConfig.langEndpoint;
console.log("FULL URL LANG: ", fullUrl);
xhr.open("GET", fullUrl);
xhr.onload = function () {
if (this.status >= 200 && this.status < 400) {
Expand Down
18 changes: 3 additions & 15 deletions web-frontend/js/set-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,13 @@ int main() {
`package main
import "fmt"
func main() {
fmt.Println("hello world")
fmt.Println("hello world from Go!")
}`
);
} else if (lang === "bash") {
} else if (lang === "bash" || lange === "sh") {
codeMirror.setValue(
`N=6
a=0
b=1
echo "The Fibonacci series is : "
for (( i=0; i<N; i++ ))
do
echo -n "$a "
fn=$((a + b))
a=$b
b=$fn
done`
"echo hello world from bash!"
);

} else {
codeMirror.setValue(
"def fibonacci(n):\n\tif n<=1:\n\t\treturn n\n\telse:\n\t\treturn(fibonacci(n-1) + fibonacci(n-2))\n\nn = 5\n\nfibo_series = []\n\nfor i in range(0,n):\n\tfibo_series.append(fibonacci(i))\n\nprint('Hello, World from Python! Here\\'s some fibonacci numbers:')\nprint(fibo_series)"
Expand Down

0 comments on commit d0ba018

Please sign in to comment.