Unverified Commit 07161e82 authored by Zachary Anderson's avatar Zachary Anderson Committed by GitHub

[flutter_tool] Don't use context in ProcessUtils (#48444)

parent 4e6d649f
......@@ -255,7 +255,7 @@ Future<int> _exit(int code) async {
}
// Run shutdown hooks before flushing logs
await runShutdownHooks();
await shutdownHooks.runShutdownHooks();
final Completer<void> completer = Completer<void>();
......
......@@ -907,7 +907,7 @@ Directory _getLocalEngineRepo({
.createTempSync('flutter_tool_local_engine_repo.');
// Remove the local engine repo before the tool exits.
addShutdownHook(
shutdownHooks.addShutdownHook(
() => localEngineRepo.deleteSync(recursive: true),
ShutdownStage.CLEANUP,
);
......
......@@ -288,7 +288,7 @@ abstract class IOSApp extends ApplicationPackage {
} else {
// Try to unpack as an ipa.
final Directory tempDir = globals.fs.systemTempDirectory.createTempSync('flutter_app.');
addShutdownHook(() async {
shutdownHooks.addShutdownHook(() async {
await tempDir.delete(recursive: true);
}, ShutdownStage.STILL_RECORDING);
os.unzip(globals.fs.file(applicationBinary), tempDir);
......
......@@ -120,8 +120,12 @@ Future<T> runInContext<T>(
OperatingSystemUtils: () => OperatingSystemUtils(),
PersistentToolState: () => PersistentToolState(),
ProcessInfo: () => ProcessInfo(),
ProcessUtils: () => ProcessUtils(),
ProcessUtils: () => ProcessUtils(
processManager: globals.processManager,
logger: globals.logger,
),
Pub: () => const Pub(),
ShutdownHooks: () => ShutdownHooks(logger: globals.logger),
Signals: () => Signals(),
SimControl: () => SimControl(),
Stdio: () => const Stdio(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment