UnknownShell class
Used by dcli to interacte with the shell environment when we are unable to detect what shell is active. This may simply be the parent process of the dart app so not a shell at all.
Constructors
- UnknownShell.withPid(int? pid, {String? processName})
- Attached to the Unknown shell with the given pid.
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- hasStartScript → bool
-
True if this shell supports a start script or configuration file.
e.g. a script that is run by the shell or a configuration file
that is read when the shell starts.
no setteroverride
- isCompletionInstalled → bool
-
no setteroverride
- isCompletionSupported → bool
-
no setteroverride
- isPrivilegedProcess → bool
-
Returns true if the process was launched as a priviliged process.
no setteroverride
- isPrivilegedUser → bool
-
Returns true if the current user this process
is running as has esclated privileges.
no setteroverride
- isSudo → bool
-
A derived class should overload this method and return true
if the script is running under sudo.
no setteroverride
- loggedInUser → String?
-
Returns the username of the logged in user.
no setteroverride
- name → String
-
The name of the shell
e.g. bash
no setteroverride
- pathToStartScript → String
-
Returns the path to the shell's start script or config file
e.g /home/
no setteroverride
- pid → int?
-
The pid of the current shell
final
- processName → String?
-
The name of the shell process.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- startScriptName → String
-
Returns the name of the shell's startup script or
configuration file
e.g. .bashrc
no setteroverride
Methods
-
addPathToMacOsPathd(
String path) → bool -
addToPATH(
String path) → bool -
the name of the process
override
-
checkInstallPreconditions(
) → String? -
Some OS/Shell combinations have some preconditions that must
be met before dcli can be installed.
override
-
install(
{bool installDart = false}) → bool -
Installs dart and dcli.
Returns true if dart was installed.
Returns false if dart was already installed.
override
-
installTabCompletion(
{bool quiet = false}) → void -
If the shell supports tab completion then
install it.
If
quiet
is true then suppress any console output except for errors.override -
matchByName(
String name) → bool -
Returns true if the shells name matches
the passed
name
. The comparison is case insensitive.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
privilegesRequiredMessage(
String app) → String -
Returns a message informing the user that they need to run
as a priviledged user to run an app.
override
-
releasePrivileges(
) → void -
On Linux and osx systems makes the script run as
a non-privileged user even when started with sudo.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
withPrivileges(
RunPrivileged privilegedCallback) → void -
When a script is run under sudo on Linux and osx and you
have previously called releasePrivileges then this method
will run
privilegedCallback
with root privileges.override
Operators
-
operator ==(
covariant UnknownShell other) → bool -
The equality operator.
override