Skip to content

Commit

Permalink
fix: Check sudo permissions on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
cyperdark authored and KotRikD committed Aug 7, 2024
1 parent 6c083e5 commit 5b952e4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/tosu/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ import { InstanceManager } from './objects/instanceManager/instanceManager';
const currentVersion = require(process.cwd() + '/_version.js');

(async () => {
if (
process.platform === 'linux' &&
process.getuid &&
process.getuid() !== 0
) {
wLogger.error(`Hello, please run tosu with sudo`);
process.exit(1);
}

wLogger.info(`Starting tosu v${currentVersion}`);

Process.disablePowerThrottling();
Expand Down

0 comments on commit 5b952e4

Please sign in to comment.