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

priviledgedUser Immutable<UserEnvironment>
latefinal
nonPriviledgedUser Immutable<UserEnvironment>
latefinal
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-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

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

Operators

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