PosixShell mixin Null safety

Provides a number of helper functions for posix based shells.

You would normally access these methods via:

Shell.current;

Occasionally you might need to access some posix specific functionality in which case (assuming you are running a posix shell) you can use:

(Shell.current as PosixShell);
Mixin Applications

Properties

isPrivilegedUser bool
True if the processes effictive uid is root.
read-only
isPrivilegedPasswordRequired bool
Returns true if running a privileged action would cause a password to be requested. [...]
read-only
isPrivilegedProcess bool
True if the processes real uid is root.
read-only
loggedInUser String
returns the username of the logged in user.
read-only
loggedInUsersHome String
Attempts to retrive the logged in user's home directory. [...]
read-only
isSudo bool
Returns true if we are currently running under sudo.
read-only
installInstructions String
Returns the instructions to install DCli.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

releasePrivileges() → void
revert uid and gid to original user's id's
restorePrivileges() → void
If a prior call to releasePrivileges has been made then this command will restore those privileges
withPrivileges(RunPrivileged action, {bool allowUnprivileged = false}) → void
Run action with root UID and gid
privilegesRequiredMessage(String app) String
The message used during installation if it needs to be run with sudo.
install({bool installDart = false, bool activate = true}) bool
Install dart/dcli
checkInstallPreconditions() String?
at this point no posix system has any preconditions.
toString() String
A string representation of this object. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited