Remove some unused variables and imports

This commit is contained in:
Radon Rosborough 2022-12-21 12:59:46 -07:00
parent 331f1c08a1
commit 65a3f43ec6
5 changed files with 19 additions and 26 deletions

View File

@ -1,5 +1,4 @@
import fsOrig, { promises as fs } from "fs"; import fsOrig from "fs";
import path from "path";
import debounce from "debounce"; import debounce from "debounce";

View File

@ -1,17 +1,18 @@
#!/usr/bin/env bash
# This script is sourced by Bash within 'make sandbox'. # This script is sourced by Bash within 'make sandbox'.
if [[ -z "$L" ]]; then if [[ -z "$L" ]]; then
echo 'environment variable unset: $L' >&2 echo "environment variable unset: \$L" >&2
exit 1 exit 1
fi fi
if [[ -z "$LANG_CONFIG" ]]; then if [[ -z "$LANG_CONFIG" ]]; then
echo 'environment variable unset: $LANG_CONFIG' >&2 echo "environment variable unset: \$LANG_CONFIG" >&2
exit 1 exit 1
fi fi
function get { function get {
jq -r ".$1" <<< "${LANG_CONFIG}" jq -r ".$1" <<<"${LANG_CONFIG}"
} }
function has { function has {
@ -24,21 +25,21 @@ function riju-exec {
function daemon { function daemon {
if has daemon; then if has daemon; then
echo "$(get daemon)" get daemon
riju-exec "$(get daemon)" riju-exec "$(get daemon)"
fi fi
} }
function setup { function setup {
if has setup; then if has setup; then
echo "$(get setup)" get setup
riju-exec "$(get setup)" riju-exec "$(get setup)"
fi fi
} }
function repl { function repl {
if has repl; then if has repl; then
echo "$(get repl)" get repl
riju-exec "$(get repl)" riju-exec "$(get repl)"
fi fi
} }
@ -47,22 +48,22 @@ function main {
if get main | grep -q /; then if get main | grep -q /; then
mkdir -p "$(dirname "$(get main)")" mkdir -p "$(dirname "$(get main)")"
fi fi
: > "$(get main)" : >"$(get main)"
has prefix && get prefix >> "$(get main)" has prefix && get prefix >>"$(get main)"
get template >> "$(get main)" get template >>"$(get main)"
has suffix && get suffix >> "$(get main)" has suffix && get suffix >>"$(get main)"
} }
function compile { function compile {
if has compile; then if has compile; then
echo "$(get compile)" get compile
riju-exec "$(get compile)" riju-exec "$(get compile)"
fi fi
} }
function run-only { function run-only {
if has run; then if has run; then
echo "$(get run)" get run
riju-exec "$(get run)" riju-exec "$(get run)"
fi fi
} }
@ -73,18 +74,18 @@ function run {
function format { function format {
if has format; then if has format; then
echo "$(get format.run)" get format.run
riju-exec "( $(get format.run) ) < $(get main)" riju-exec "( $(get format.run) ) < $(get main)"
fi fi
} }
function lsp { function lsp {
if has lsp.setup; then if has lsp.setup; then
echo "$(get lsp.setup)" get lsp.setup
riju-exec "$(get lsp.setup)" riju-exec "$(get lsp.setup)"
fi fi
if has lsp; then if has lsp; then
echo "$(get lsp.start)" get lsp.start
riju-exec "$(get lsp.start)" riju-exec "$(get lsp.start)"
fi fi
} }

View File

@ -6,11 +6,9 @@ import { readLangConfig } from "../lib/yaml.js";
import { import {
bash, bash,
getUUID, getUUID,
privilegedExec,
privilegedPty, privilegedPty,
privilegedSession, privilegedSession,
quote, quote,
run,
} from "./util.js"; } from "./util.js";
function die(msg) { function die(msg) {
@ -18,10 +16,6 @@ function die(msg) {
process.exit(1); process.exit(1);
} }
function log(msg) {
console.log(msg);
}
async function main() { async function main() {
const sandboxScript = await fs.readFile("backend/sandbox.bash", "utf-8"); const sandboxScript = await fs.readFile("backend/sandbox.bash", "utf-8");
const lang = process.env.L; const lang = process.env.L;

View File

@ -10,7 +10,7 @@ import { getTestHash } from "../lib/hash-test.js";
import * as api from "./api.js"; import * as api from "./api.js";
import { langsPromise } from "./langs.js"; import { langsPromise } from "./langs.js";
import { shutdown } from "./shutdown.js"; import { shutdown } from "./shutdown.js";
import { getUUID, run } from "./util.js"; import { run } from "./util.js";
let langs = {}; let langs = {};
@ -525,7 +525,7 @@ const testTypes = {
ensure: { ensure: {
pred: ({ ensure }) => (ensure ? true : false), pred: ({ ensure }) => (ensure ? true : false),
}, },
run: { pred: (config) => true }, run: { pred: (_config) => true },
repl: { repl: {
pred: ({ repl }) => (repl ? true : false), pred: ({ repl }) => (repl ? true : false),
}, },

View File

@ -1,5 +1,4 @@
import { spawn } from "child_process"; import { spawn } from "child_process";
import os from "os";
import process from "process"; import process from "process";
import * as Sentry from "@sentry/node"; import * as Sentry from "@sentry/node";