PosixShell mixin

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

hashCode int
The hash code for this object.
no setterinherited
installInstructions String
Returns the instructions to install DCli.
no setter
isPrivilegedPasswordRequired bool
Returns true if running a privileged action would cause a password to be requested.
no setter
isPrivilegedProcess bool
True if the processes real uid is root.
no setter
isPrivilegedUser bool
True if the processes effictive uid is root.
no setter
isSudo bool
Returns true if we are currently running under sudo.
no setter
loggedInUser String
returns the username of the logged in user.
no setter
loggedInUsersHome String
Attempts to retrive the logged in user's home directory.
no setter
nonPriviledgedUser Immutable<UserEnvironment>
latefinal
priviledgedUser Immutable<UserEnvironment>
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

checkInstallPreconditions() String?
at this point no posix system has any preconditions.
install({bool installDart = false, bool activate = true}) Future<bool>
Install dart/dcli
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent 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