Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Conditonally delete.
  • Loading branch information
matanlurey committed Sep 10, 2024
commit 0078d9b535d3bc237890924439e6ce63b0868cf1
12 changes: 9 additions & 3 deletions testing/scenario_app/bin/run_ios_tests.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ void main(List<String> args) async {
}
}

void _deleteIfPresent(io.FileSystemEntity entity) {
if (entity.existsSync()) {
entity.deleteSync(recursive: true);
}
}

/// Runs the script.
///
/// The [cleanup] set contains cleanup tasks to run when the script is either
Expand Down Expand Up @@ -127,7 +133,7 @@ Future<void> _run(
iosEngineVariant: iosEngineVariant,
);

cleanup.add(() => resultBundle.deleteSync(recursive: true));
cleanup.add(() => _deleteIfPresent(resultBundle));

if (withSkia) {
io.stderr.writeln('Running simulator tests with Skia');
Expand Down Expand Up @@ -165,7 +171,7 @@ Future<void> _run(
} else {
io.stderr.writeln('test succcess.');
}
resultBundle.deleteSync(recursive: true);
_deleteIfPresent(resultBundle);
}

if (withImpeller) {
Expand Down Expand Up @@ -197,7 +203,7 @@ Future<void> _run(
} else {
io.stderr.writeln('test succcess.');
}
resultBundle.deleteSync(recursive: true);
_deleteIfPresent(resultBundle);
}
}

Expand Down