Browse Source

Show proper shell mark depending on user

pull/394/head
BrainStone 4 years ago
parent
commit
1f24c7efa6
No known key found for this signature in database GPG Key ID: 66CCC234C2CEB306
  1. 6
      src/lib/Util.js

6
src/lib/Util.js

@ -2,6 +2,8 @@
const childProcess = require('child_process');
const shellSymbol = (process.getuid() === 0) ? '#' : '$';
module.exports = class Util {
static isValidIPv4(str) {
@ -57,10 +59,10 @@ module.exports = class Util {
} = {}) {
if (typeof log === 'string') {
// eslint-disable-next-line no-console
console.log(`$ ${log}`);
console.log(`${shellSymbol} ${log}`);
} else if (log === true) {
// eslint-disable-next-line no-console
console.log(`$ ${cmd}`);
console.log(`${shellSymbol} ${cmd}`);
}
if (process.platform !== 'linux') {

Loading…
Cancel
Save