diff --git a/firka/codegen-lock.yaml b/firka/codegen-lock.yaml index e576eb6..cef0670 100644 --- a/firka/codegen-lock.yaml +++ b/firka/codegen-lock.yaml @@ -1,6 +1,6 @@ icons: "flutter_launcher_icons.yaml": "c600507ca0df7cebd0f708124842512a14ed3d597b779176200d6ba25b1335b1" - "pubspec.yaml": "c84752e36ab6218d2ac824c17ffb0edb5ac4f809ab87784c9c607a0d9f525abb" + "pubspec.yaml": "cc5c8123f956bca34e25cec666ccc13fe5b7bdec06e217a58e1fa0ee58dedc20" "assets/images/logos/colored_logo.webp": "4b4fa99d144fe6694aa4487ba1b26aeecafae41e3c877836cd7da28d61a77983" "assets/images/logos/monochrome_logo.png": "188d2b0a64c70323b09bcee721663d6698fb557066f20ddaec97bba6869c1c6c" "assets/images/logos/colored_logo_without_mustache.png": "d11cff9f38985885873bfdd2d84e61f8fab03803eada94d4caac1545ef3685f3" diff --git a/firka/scripts/codegen.dart b/firka/scripts/codegen.dart index 4a51289..875b3df 100644 --- a/firka/scripts/codegen.dart +++ b/firka/scripts/codegen.dart @@ -13,10 +13,33 @@ void main() async { if (_iconsOutOfDate(root)) { final inputs = _iconsInputs(root); - stdout.writeln('Icons out of date, running flutter_launcher_icons...'); - await _run('dart', ['run', 'flutter_launcher_icons'], root); - _updateLockWithHashes(root, 'icons', _computeHashes(root, inputs)); - ran = true; + final manifestFile = File(p.join(root, 'android/app/src/main/AndroidManifest.xml')); + String? manifestBackup; + if (manifestFile.existsSync()) { + manifestBackup = manifestFile.readAsStringSync(); + } + late ProcessResult iconResult; + try { + stdout.writeln('Icons out of date, running flutter_launcher_icons...'); + iconResult = await Process.run( + 'dart', + ['run', 'flutter_launcher_icons'], + workingDirectory: root, + runInShell: true, + ); + if (iconResult.exitCode == 0) { + _updateLockWithHashes(root, 'icons', _computeHashes(root, inputs)); + ran = true; + } + } finally { + if (manifestBackup != null) { + manifestFile.writeAsStringSync(manifestBackup); + } + } + if (iconResult.exitCode != 0) { + stderr.write(iconResult.stderr); + exit(iconResult.exitCode); + } } if (_l10nOutOfDate(root)) {