From a4678e45deeac110acd76388983f27c6f68e8c07 Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Sun, 2 Sep 2018 04:48:42 +0900 Subject: [PATCH] Not check dependencies --- src/index.ts | 2 -- src/misc/dependencyInfo.ts | 32 -------------------------------- 2 files changed, 34 deletions(-) delete mode 100644 src/misc/dependencyInfo.ts diff --git a/src/index.ts b/src/index.ts index 470699eab..ed23ff7e7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -20,7 +20,6 @@ import Logger from './misc/logger'; import ProgressBar from './misc/cli/progressbar'; import EnvironmentInfo from './misc/environmentInfo'; import MachineInfo from './misc/machineInfo'; -import DependencyInfo from './misc/dependencyInfo'; import serverStats from './daemons/server-stats'; import notesStats from './daemons/notes-stats'; import loadConfig from './config/load'; @@ -116,7 +115,6 @@ async function init(): Promise { new Logger('Deps').info(`Node.js ${process.version}`); MachineInfo.show(); EnvironmentInfo.show(); - new DependencyInfo().showAll(); const configLogger = new Logger('Config'); let config; diff --git a/src/misc/dependencyInfo.ts b/src/misc/dependencyInfo.ts deleted file mode 100644 index 09d282822..000000000 --- a/src/misc/dependencyInfo.ts +++ /dev/null @@ -1,32 +0,0 @@ -import Logger from './logger'; -import { execSync } from 'child_process'; - -export default class { - private logger: Logger; - - constructor() { - this.logger = new Logger('Deps'); - } - - public showAll(): void { - this.show('MongoDB', 'mongo --version', x => x.match(/^MongoDB shell version:? v(.*)\r?\n/)); - this.show('Redis', 'redis-server --version', x => x.match(/v=([0-9\.]*)/)); - } - - public show(serviceName: string, command: string, transform: (x: string) => RegExpMatchArray): void { - try { - // ステータス0以外のときにexecSyncはstderrをコンソール上に出力してしまうので - // プロセスからのstderrをすべて無視するように stdio オプションをセット - const x = execSync(command, { stdio: ['pipe', 'pipe', 'ignore'] }); - const ver = transform(x.toString()); - if (ver != null) { - this.logger.succ(`${serviceName} ${ver[1]} found`); - } else { - this.logger.warn(`${serviceName} not found`); - this.logger.warn(`Regexp used for version check of ${serviceName} is probably messed up`); - } - } catch (e) { - this.logger.warn(`${serviceName} not found`); - } - } -}