anaisbetts / squirrel-flutter

Build installers for your Flutter applications with Squirrel
BSD 3-Clause "New" or "Revised" License
57 stars 13 forks source link

Unhandled exception when running without releaseUrl #3

Closed RustamG closed 2 years ago

RustamG commented 2 years ago

I'm getting an error when release URL is not specified (neither in pubspec nor via env SQUIRREL_RELEASE_URL). Here is an example of pubspec.yaml section of

#.....
squirrel:
  windows:
    appFriendlyName: "Test App"
    appDescription: "Test App main application."
    appIcon: "windows/runner/resources/app_icon.ico"
    releaseDirectory: "ReleaseDir"

Error

Unhandled exception:
Exception: Failed to run c:\users\rustamg\appdata\local\pub\cache\hosted\pub.dartlang.org\squirrel-0.1.0\vendor\SyncReleases.exe -r c:\users\rustamg\test\test_squirrel\ReleaseDir -u c:\use
rs\rustamg\test\test_squirrel\null
Usage: SyncReleases.exe command [OPTS]
Builds a Releases directory from releases on GitHub

Options:
  -h, -?, --help             Display Help and exit
  -r, --releaseDir=VALUE     Path to a release directory to download to
  -u, --url=VALUE            When pointing to GitHub, use the URL to the
                               repository root page, else point to an existing
                               remote Releases folder
  -t, --token=VALUE          The OAuth token to use as login credentials

#0      runUtil (file:///C:/Users/RustamG/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/squirrel-0.1.0/bin/installer_windows.dart:200:5)
<asynchronous suspension>
#1      main (file:///C:/Users/RustamG/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/squirrel-0.1.0/bin/installer_windows.dart:291:5)
<asynchronous suspension>
pub finished with exit code 255

The issue seems to be here: https://github.com/anaisbetts/squirrel-flutter/blob/2979ed912f28b4b8b273db4ac19779868a9a9b2e/bin/installer_windows.dart#L163-L165

? should be placed before .toString(). Otherwise null becomes a string with a value "null".

RustamG commented 2 years ago

@anaisbetts, Please, have a look

RustamG commented 2 years ago

Hi @anaisbetts! Any chance a new version gets published soon?

anaisbetts commented 2 years ago

@RustamG It's on my to-do list to finish this package, it's currently broken altogether with the latest Flutter because they create Snapshots of pub run tools which breaks some of the code here.