Skip to content

Commit

Permalink
fix(shorebird_cli): adjust engine file permissions (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
felangel authored Mar 7, 2023
1 parent b78899c commit 32a567d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/actions/dart_package/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ runs:

- working-directory: ${{ inputs.working_directory }}
shell: ${{ inputs.shell }}
run: dart analyze --fatal-infos --fatal-warnings ${{inputs.analyze_directories}}
run: dart analyze --fatal-warnings ${{inputs.analyze_directories}}

- working-directory: ${{ inputs.working_directory }}
shell: ${{ inputs.shell }}
Expand Down
24 changes: 24 additions & 0 deletions packages/shorebird_cli/lib/src/commands/run_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class RunCommand extends Command<int> {
await _extractShorebirdEngine(
shorebirdEngineCache.path,
shorebirdEngine.path,
_startProcess,
);
buildingEngine.complete();
} catch (error) {
Expand Down Expand Up @@ -150,6 +151,7 @@ Future<void> _downloadShorebirdEngine(
Future<void> _extractShorebirdEngine(
String archivePath,
String targetPath,
StartProcess startProcess,
) async {
final targetDirectory = Directory(targetPath);

Expand All @@ -164,4 +166,26 @@ Future<void> _extractShorebirdEngine(
extractArchiveToDisk(archive, targetPath);
},
);

// TODO(felangel): support windows and linux
// https://github.com/shorebirdtech/shorebird/issues/37
// coverage:ignore-start
if (Platform.isMacOS) {
const executables = [
'flutter/prebuilts/macos-x64/dart-sdk/bin/dart',
'flutter/prebuilts/macos-x64/dart-sdk/bin/dartaotruntime',
'out/android_release_arm64/clang_x64/gen_snapshot',
'out/android_release_arm64/clang_x64/gen_snapshot_arm64',
'out/android_release_arm64/clang_x64/impellerc',
];

for (final executable in executables) {
final process = await startProcess(
'chmod',
['+x', p.join(targetPath, executable)],
);
await process.exitCode;
}
}
// coverage:ignore-end
}

0 comments on commit 32a567d

Please sign in to comment.