Handle when VS Code fails to load

This is mostly for development where VS Code might not have finished
compiling yet.
This commit is contained in:
Asher
2020-02-05 14:21:59 -06:00
parent 7c6fe56043
commit 6e809b6a31
9 changed files with 205 additions and 183 deletions

View File

@@ -23,7 +23,7 @@ const main = async (args: Args = {}): Promise<void> => {
const auth = args.auth || AuthType.Password
const originalPassword = auth === AuthType.Password && (process.env.PASSWORD || (await generatePassword()))
let commit = "development"
let commit: string | undefined
try {
commit = require("../../package.json").commit
} catch (error) {
@@ -36,7 +36,7 @@ const main = async (args: Args = {}): Promise<void> => {
basePath: args["base-path"],
cert: args.cert,
certKey: args["cert-key"],
commit,
commit: commit || "development",
host: args.host || (args.auth === AuthType.Password && typeof args.cert !== "undefined" ? "0.0.0.0" : "localhost"),
password: originalPassword ? hash(originalPassword) : undefined,
port: typeof args.port !== "undefined" ? parseInt(args.port, 10) : 8080,