core: allow --legacy

This commit is contained in:
undefined committed 2021-01-03 18:01:45 +08:00
1 parent c89ef43a88
commit ea19d7997e
2 files changed
+5 -4

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.15.8",
"version": "2.15.9",
"bin": "bin/hydrooj.js",
"main": "dist/loader.js",
"typings": "dist/loader.d.ts",
+4 -3
View File
@@ -4,6 +4,7 @@ import cluster from 'cluster';
import {
terminal, TextBox, LabeledInput,
} from 'terminal-kit';
import { argv } from 'yargs';
import * as bus from './service/bus';
declare module 'terminal-kit/Terminal' {
@@ -30,7 +31,7 @@ export namespace Progress {
}
export function create(args) {
return process.stdout.isTTY
return (process.stdout.isTTY && !argv.legacy)
? terminal.progressBar(args)
: new Progress(args);
}
@@ -43,7 +44,7 @@ async function terminate() {
} catch (e) {
hasError = true;
}
if (cluster.isMaster && process.stdout.isTTY) {
if (cluster.isMaster && process.stdout.isTTY && !argv.legacy) {
terminal.hideCursor(false);
terminal.styleReset();
terminal.resetScrollingRegion();
@@ -54,7 +55,7 @@ async function terminate() {
}
process.on('SIGINT', terminate);
if (cluster.isMaster && process.stdout.isTTY) {
if (cluster.isMaster && process.stdout.isTTY && !argv.legacy) {
terminal.clear();
terminal.grabInput();
terminal.hideCursor();