Skip to content

Commit

Permalink
Merge pull request #32 from dmk-rib/nullsafety
Browse files Browse the repository at this point in the history
fixed 'Wrong executable selection''
  • Loading branch information
YehudaKremer authored Mar 23, 2021
2 parents f366b5e + 8c32ab9 commit d1945a0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ pubspec.lock

# Directory created by dartdoc
doc/api/
/.vs
13 changes: 8 additions & 5 deletions lib/src/configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,14 @@ class Configuration {
throw (red(
'Build files not found as $buildFilesFolder, first run "flutter build windows" then try again'));

executableFileName = await Directory(buildFilesFolder)
.list()
.map((file) => basename(file.path))
.firstWhere((fileName) => fileName.contains('.exe'),
orElse: () => '$appName.exe');
final executables = await Directory(buildFilesFolder)
.list()
.map((file) => basename(file.path))
.where((fileName) => fileName.contains('.exe'))
.toList();
executableFileName = executables.firstWhere(
(exeName) => exeName == '$appName.exe',
orElse: () => executables.first);

if (!RegExp(r'^(\*|\d+(\.\d+){3,3}(\.\*)?)$').hasMatch(msixVersion!))
throw (red('Msix version can be only in this format: "1.0.0.0"'));
Expand Down
8 changes: 4 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ environment:
dependencies:
flutter:
sdk: flutter
path: ^1.7.0
yaml: ^3.1.0
ansicolor: ^2.0.0-nullsafety.0
ansicolor: ^2.0.1
args: ^2.0.0
package_config: ^2.0.0
package_config: ^2.0.0
path: ^1.8.0
yaml: ^3.1.0

0 comments on commit d1945a0

Please sign in to comment.