Skip to content

Commit 165ae23

Browse files
authored
fix: throw on copy failure in _copyTemplateProject (#109)
1 parent a1d4df6 commit 165ae23

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/shorebird_tests/test/shorebird_tests.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,16 +157,20 @@ Future<Directory> _copyTemplateProject() async {
157157
);
158158

159159
// Use platform copy to preserve the full directory tree efficiently.
160+
final ProcessResult result;
160161
if (Platform.isWindows) {
161-
await Process.run('xcopy', [
162+
result = await Process.run('xcopy', [
162163
template.path,
163164
testDir.path,
164165
'/E',
165166
'/I',
166167
'/Q',
167168
]);
168169
} else {
169-
await Process.run('cp', ['-R', template.path, testDir.path]);
170+
result = await Process.run('cp', ['-R', template.path, testDir.path]);
171+
}
172+
if (result.exitCode != 0) {
173+
throw Exception('Failed to copy template project: ${result.stderr}');
170174
}
171175

172176
return testDir;

0 commit comments

Comments
 (0)