From 6ead284f31564a2fd1905a5683a94fbc33dc45f9 Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Sat, 31 Dec 2016 03:24:07 +0900 Subject: [PATCH] Rename DependencyChecker to DependencyInfo --- src/index.ts | 4 ++-- .../{dependencyChecker.ts => dependencyInfo.ts} | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) rename src/utils/{dependencyChecker.ts => dependencyInfo.ts} (61%) diff --git a/src/index.ts b/src/index.ts index c4cba4d46e..947408e523 100644 --- a/src/index.ts +++ b/src/index.ts @@ -19,7 +19,7 @@ const isRoot = require('is-root'); import ProgressBar from './utils/cli/progressbar'; import initdb from './db/mongodb'; import MachineInfo from './utils/machineInfo'; -import DependencyChecker from './utils/dependencyChecker'; +import DependencyInfo from './utils/dependencyInfo'; // Init babel require('babel-core/register'); @@ -160,7 +160,7 @@ async function init(): Promise { } MachineInfo.show(); - new DependencyChecker().checkAll(); + new DependencyInfo().showAll(); let configLogger = new Logger('Config'); if (!fs.existsSync(`${__dirname}/../.config/config.yml`)) { diff --git a/src/utils/dependencyChecker.ts b/src/utils/dependencyInfo.ts similarity index 61% rename from src/utils/dependencyChecker.ts rename to src/utils/dependencyInfo.ts index 2036ebe369..e0d8f24d74 100644 --- a/src/utils/dependencyChecker.ts +++ b/src/utils/dependencyInfo.ts @@ -1,23 +1,23 @@ import Logger from './logger'; import { exec } from 'shelljs'; -export default class DependencyChecker { +export default class DependencyInfo { logger: Logger; constructor() { this.logger = new Logger('Deps'); } - checkAll(): void { + showAll(): void { this.logger.info('Checking started'); - this.check('Node.js', 'node -v', x => x.match(/^v(.*)\r?\n$/)); - this.check('npm', 'npm -v', x => x.match(/^(.*)\r?\n$/)); - this.check('MongoDB', 'mongo --version', x => x.match(/^MongoDB shell version: (.*)\r?\n$/)); - this.check('Redis', 'redis-server --version', x => x.match(/v=([0-9\.]*)/)); + this.show('Node.js', 'node -v', x => x.match(/^v(.*)\r?\n$/)); + this.show('npm', 'npm -v', x => x.match(/^(.*)\r?\n$/)); + this.show('MongoDB', 'mongo --version', x => x.match(/^MongoDB shell version: (.*)\r?\n$/)); + this.show('Redis', 'redis-server --version', x => x.match(/v=([0-9\.]*)/)); this.logger.info('Checking finished'); } - check(serviceName: string, command: string, transform: (x: string) => RegExpMatchArray): void { + show(serviceName: string, command: string, transform: (x: string) => RegExpMatchArray): void { const code = { success: 0, notFound: 127