Skip to content

Commit

Permalink
feat: adds dry run
Browse files Browse the repository at this point in the history
  • Loading branch information
nyoungstudios committed Sep 25, 2022
1 parent 891633f commit dcd1653
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bin/alfa.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ void main(List<String> args) async {
var parser = ArgParser();
parser.addFlag('help',
abbr: 'h', help: 'Print this usage information.', negatable: false);
parser.addFlag('dry-run',
abbr: 'n', help: 'Only prints what will be installed.', negatable: false);
parser.addFlag('exit',
abbr: 'e',
help:
Expand Down Expand Up @@ -169,6 +171,12 @@ void main(List<String> args) async {
print('');
print('--------------------------------------------');

// exits if dry run is set to true
if (argResults['dry-run']) {
print('Exiting alfa, dry run mode enabled.');
exit(0);
}

// sets executable
String executable;
if (user == null || user == 'root') {
Expand Down

0 comments on commit dcd1653

Please sign in to comment.