Skip to content

Commit

Permalink
Update resources for root
Browse files Browse the repository at this point in the history
  • Loading branch information
dispherical committed Sep 10, 2024
1 parent 72dec0c commit 1ce7675
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cli/commands/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ module.exports = function ({ program, run }) {
.command('resources')
.description('See your Nest resource usage and limits')
.action(() => {
if (!process.getuid()){
console.log("Root doesn't have any limits.")
process.exit(0)
}
const output = run(`quota`).toString();
const numbers = output.split("\n").find(line => line.includes("/dev/sda")).match(/\d+/g);
const array = numbers.map(Number)
Expand Down

0 comments on commit 1ce7675

Please sign in to comment.