From b73eb710e42985789c0e029bd982a44be614105e Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 18 Mar 2017 02:24:14 +0900 Subject: [PATCH] Clean up --- package.json | 1 - src/index.ts | 4 +--- src/utils/lastCommitInfo.ts | 21 --------------------- src/web/meta.ts | 13 ------------- src/web/server.ts | 1 - 5 files changed, 1 insertion(+), 39 deletions(-) delete mode 100644 src/utils/lastCommitInfo.ts delete mode 100644 src/web/meta.ts diff --git a/package.json b/package.json index 2850d4a46..65f641cb1 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,6 @@ "express": "4.15.2", "file-type": "4.1.0", "fuckadblock": "3.2.1", - "git-last-commit": "0.2.0", "glob": "7.1.1", "gm": "1.23.0", "gulp": "3.9.1", diff --git a/src/index.ts b/src/index.ts index 5475099aa..54a86e365 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,10 +13,9 @@ import * as cluster from 'cluster'; import * as debug from 'debug'; import Logger from './utils/logger'; import * as chalk from 'chalk'; -import portUsed = require('tcp-port-used'); +//import portUsed = require('tcp-port-used'); import isRoot = require('is-root'); import ProgressBar from './utils/cli/progressbar'; -import LastCommitInfo from './utils/lastCommitInfo'; import EnvironmentInfo from './utils/environmentInfo'; import MachineInfo from './utils/machineInfo'; import DependencyInfo from './utils/dependencyInfo'; @@ -98,7 +97,6 @@ async function init() { Logger.info(chalk.bold('Misskey ')); Logger.info('Initializing...'); - await LastCommitInfo.show(); EnvironmentInfo.show(); MachineInfo.show(); new DependencyInfo().showAll(); diff --git a/src/utils/lastCommitInfo.ts b/src/utils/lastCommitInfo.ts deleted file mode 100644 index 9682365da..000000000 --- a/src/utils/lastCommitInfo.ts +++ /dev/null @@ -1,21 +0,0 @@ -import Logger from './logger'; -import * as chalk from 'chalk'; -import prominence = require('prominence'); -import git = require('git-last-commit'); - -export default class { - static async show(): Promise { - let logger = new Logger('LastCommit'); - try { - const commit = await prominence(git).getLastCommit(); - const shortHash: string = commit.shortHash; - const hash: string = commit.hash; - const commitDate = new Date(parseInt(commit.committedOn, 10) * 1000).toLocaleDateString('ja-JP'); - const commitTime = new Date(parseInt(commit.committedOn, 10) * 1000).toLocaleTimeString('ja-JP'); - logger.info(`${shortHash}${chalk.gray(hash.substr(shortHash.length))}`); - logger.info(`${commit.subject} ${chalk.green(`(${commitDate} ${commitTime})`)} ${chalk.blue(`<${commit.author.name}>`)}`); - } catch (e) { - logger.info('No commit information found'); - } - } -} diff --git a/src/web/meta.ts b/src/web/meta.ts deleted file mode 100644 index 41bba8c0b..000000000 --- a/src/web/meta.ts +++ /dev/null @@ -1,13 +0,0 @@ -import * as express from 'express'; -import git = require('git-last-commit'); - -module.exports = async (req: express.Request, res: express.Response) => { - // Get commit info - git.getLastCommit((err, commit) => { - res.send({ - commit: commit - }); - }, { - dst: `${__dirname}/../../` - }); -}; diff --git a/src/web/server.ts b/src/web/server.ts index 70083753b..baad0f6c6 100644 --- a/src/web/server.ts +++ b/src/web/server.ts @@ -47,7 +47,6 @@ app.use('/resources', express.static(`${__dirname}/resources`, { /** * Common API */ -app.get(/\/api:meta/, require('./meta')); app.get(/\/api:url/, require('./service/url-preview')); app.post(/\/api:rss/, require('./service/rss-proxy'));