-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change Y variable to X; no more auto sudo for methods of install and …
…remove
- Loading branch information
Showing
9 changed files
with
107 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,53 @@ | ||
/// A boolean value indicating whether the current environment is a Snap environment. | ||
bool _isSnap = false; | ||
bool _hasSnap = false; | ||
|
||
/// A boolean value indicating whether the current environment is a Flatpak environment. | ||
bool _isFlatpak = false; | ||
bool _hasFlatpak = false; | ||
|
||
/// A boolean value indicating whether the current environment is an AppImage environment. | ||
bool _isAppImage = false; | ||
bool _hasAppImage = false; | ||
|
||
/// The path to the sudo command. | ||
String _sudoPath = ''; | ||
|
||
String _updateCommand = ''; | ||
|
||
/// A class that provides global variables and methods. | ||
class Global { | ||
/// Gets or sets a value indicating whether the current environment is a Snap environment. | ||
static bool get isSnap => _isSnap; | ||
static set isSnap(bool value) { | ||
_isSnap = value; | ||
static bool get hasSnap => _hasSnap; | ||
static set hasSnap(bool value) { | ||
_hasSnap = value; | ||
if (value) { | ||
_isFlatpak = false; | ||
_isAppImage = false; | ||
_hasFlatpak = false; | ||
_hasAppImage = false; | ||
} | ||
} | ||
|
||
/// Gets or sets a value indicating whether the current environment is a Flatpak environment. | ||
static bool get isFlatpak => _isFlatpak; | ||
static set isFlatpak(bool value) { | ||
_isFlatpak = value; | ||
static bool get hasFlatpak => _hasFlatpak; | ||
static set hasFlatpak(bool value) { | ||
_hasFlatpak = value; | ||
if (value) { | ||
_isSnap = false; | ||
_isAppImage = false; | ||
_hasSnap = false; | ||
_hasAppImage = false; | ||
} | ||
} | ||
|
||
/// Gets or sets a value indicating whether the current environment is an AppImage environment. | ||
static bool get isAppImage => _isAppImage; | ||
static set isAppImage(bool value) { | ||
_isAppImage = value; | ||
static bool get hasAppImage => _hasAppImage; | ||
static set hasAppImage(bool value) { | ||
_hasAppImage = value; | ||
if (value) { | ||
_isSnap = false; | ||
_isFlatpak = false; | ||
_hasSnap = false; | ||
_hasFlatpak = false; | ||
} | ||
} | ||
|
||
/// Gets or sets the path to the sudo command. | ||
static String get sudoPath => _sudoPath; | ||
static set sudoPath(String value) => _sudoPath = value; | ||
|
||
static String get updateCommand => _updateCommand; | ||
static set updateCommand(String value) => _updateCommand = value; | ||
} |
Oops, something went wrong.