From ab54e147f2a170f2a4ee841ace8537e0ab6a1dab Mon Sep 17 00:00:00 2001 From: rinsuki <428rinsuki+git@gmail.com> Date: Thu, 19 Aug 2021 16:27:12 +0900 Subject: Remove is-root dependencies (#7660) --- src/boot/master.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/boot/master.ts') diff --git a/src/boot/master.ts b/src/boot/master.ts index 473e215bac..3d86a5dab8 100644 --- a/src/boot/master.ts +++ b/src/boot/master.ts @@ -2,7 +2,6 @@ import * as os from 'os'; import * as cluster from 'cluster'; import * as chalk from 'chalk'; import * as portscanner from 'portscanner'; -import * as isRoot from 'is-root'; import { getConnection } from 'typeorm'; import Logger from '../services/logger'; @@ -39,6 +38,11 @@ function greet() { bootLogger.info(`Misskey v${meta.version}`, null, true); } +function isRoot() { + // maybe process.getuid will be undefined under not POSIX environment (e.g. Windows) + return process.getuid != null && process.getuid() === 0; +} + /** * Init master process */ -- cgit v1.2.3-freya