@@ -26,7 +26,7 @@ class FirefoxArgParser extends BrowserArgParser {
2626 @override
2727 void populateOptions (ArgParser argParser) {
2828 final YamlMap browserLock = BrowserLock .instance.configuration;
29- String firefoxVersion = browserLock['firefox' ]['version' ] as String ;
29+ final String firefoxVersion = browserLock['firefox' ]['version' ] as String ;
3030
3131 argParser
3232 ..addOption (
@@ -196,7 +196,7 @@ class FirefoxInstaller {
196196
197197 final io.File downloadedFile =
198198 io.File (path.join (versionDir.path, PlatformBinding .instance.getFirefoxDownloadFilename (version)));
199- io.IOSink sink = downloadedFile.openWrite ();
199+ final io.IOSink sink = downloadedFile.openWrite ();
200200 await download.stream.pipe (sink);
201201 await sink.flush ();
202202 await sink.close ();
@@ -226,12 +226,12 @@ class FirefoxInstaller {
226226 /// Mounts the dmg file using hdiutil, copies content of the volume to
227227 /// target path and then unmounts dmg ready for deletion.
228228 Future <void > _mountDmgAndCopy (io.File dmgFile) async {
229- String volumeName = await _hdiUtilMount (dmgFile);
229+ final String volumeName = await _hdiUtilMount (dmgFile);
230230
231231 final String sourcePath = '$volumeName /Firefox.app' ;
232232 final String targetPath = path.dirname (dmgFile.path);
233233 try {
234- io.ProcessResult installResult = await io.Process .run ('cp' , < String > [
234+ final io.ProcessResult installResult = await io.Process .run ('cp' , < String > [
235235 '-r' ,
236236 sourcePath,
237237 targetPath,
@@ -249,7 +249,7 @@ class FirefoxInstaller {
249249 }
250250
251251 Future <String > _hdiUtilMount (io.File dmgFile) async {
252- io.ProcessResult mountResult = await io.Process .run ('hdiutil' , < String > [
252+ final io.ProcessResult mountResult = await io.Process .run ('hdiutil' , < String > [
253253 'attach' ,
254254 '-readonly' ,
255255 '${dmgFile .path }' ,
@@ -260,7 +260,7 @@ class FirefoxInstaller {
260260 'Exit code ${mountResult .exitCode }.\n ${mountResult .stderr }' );
261261 }
262262
263- List <String > processOutput = (mountResult.stdout as String ).split ('\n ' );
263+ final List <String > processOutput = (mountResult.stdout as String ).split ('\n ' );
264264 final String ? volumePath = _volumeFromMountResult (processOutput);
265265 if (volumePath == null ) {
266266 throw BrowserInstallerException (
@@ -274,7 +274,7 @@ class FirefoxInstaller {
274274 // Output is of form: {devicename} /Volumes/{name}.
275275 String ? _volumeFromMountResult (List <String > lines) {
276276 for (String line in lines) {
277- int pos = line.indexOf ('/Volumes' );
277+ final int pos = line.indexOf ('/Volumes' );
278278 if (pos != - 1 ) {
279279 return line.substring (pos);
280280 }
@@ -283,7 +283,7 @@ class FirefoxInstaller {
283283 }
284284
285285 Future <void > _hdiUtilUnmount (String volumeName) async {
286- io.ProcessResult unmountResult = await io.Process .run ('hdiutil' , < String > [
286+ final io.ProcessResult unmountResult = await io.Process .run ('hdiutil' , < String > [
287287 'unmount' ,
288288 '$volumeName ' ,
289289 ]);
@@ -302,7 +302,7 @@ class FirefoxInstaller {
302302Future <String > _findSystemFirefoxExecutable () async {
303303 final io.ProcessResult which =
304304 await io.Process .run ('which' , < String > ['firefox' ]);
305- bool found = which.exitCode != 0 ;
305+ final bool found = which.exitCode != 0 ;
306306 const String fireFoxDefaultInstallPath =
307307 '/Applications/Firefox.app/Contents/MacOS/firefox' ;
308308 if (! found) {
0 commit comments