mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-11-23 06:25:14 +00:00
Not check dependencies
This commit is contained in:
parent
f24869625e
commit
a4678e45de
2 changed files with 0 additions and 34 deletions
|
@ -20,7 +20,6 @@ import Logger from './misc/logger';
|
||||||
import ProgressBar from './misc/cli/progressbar';
|
import ProgressBar from './misc/cli/progressbar';
|
||||||
import EnvironmentInfo from './misc/environmentInfo';
|
import EnvironmentInfo from './misc/environmentInfo';
|
||||||
import MachineInfo from './misc/machineInfo';
|
import MachineInfo from './misc/machineInfo';
|
||||||
import DependencyInfo from './misc/dependencyInfo';
|
|
||||||
import serverStats from './daemons/server-stats';
|
import serverStats from './daemons/server-stats';
|
||||||
import notesStats from './daemons/notes-stats';
|
import notesStats from './daemons/notes-stats';
|
||||||
import loadConfig from './config/load';
|
import loadConfig from './config/load';
|
||||||
|
@ -116,7 +115,6 @@ async function init(): Promise<Config> {
|
||||||
new Logger('Deps').info(`Node.js ${process.version}`);
|
new Logger('Deps').info(`Node.js ${process.version}`);
|
||||||
MachineInfo.show();
|
MachineInfo.show();
|
||||||
EnvironmentInfo.show();
|
EnvironmentInfo.show();
|
||||||
new DependencyInfo().showAll();
|
|
||||||
|
|
||||||
const configLogger = new Logger('Config');
|
const configLogger = new Logger('Config');
|
||||||
let config;
|
let config;
|
||||||
|
|
|
@ -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`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue