Skip to content

Commit

Permalink
fixed check for running process as root
Browse files Browse the repository at this point in the history
  • Loading branch information
ejnshtein committed Jun 28, 2022
1 parent 61568bf commit 10b808c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion build-packages/magento-scripts/lib/util/is-running-root.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const isRunningRoot = () => process.getuid() === 0; // UID 0 is always root
const os = require('os');

const isRunningRoot = () => ['linux', 'darwin'].includes(os.platform()) && process.getuid() === 0; // UID 0 is always root

module.exports = isRunningRoot;

0 comments on commit 10b808c

Please sign in to comment.