Skip to content

Commit

Permalink
chore: log process on GitHub Action
Browse files Browse the repository at this point in the history
  • Loading branch information
HelloCore committed Oct 3, 2023
1 parent d6c30c0 commit 7f5bc14
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/danger_core/lib/src/danger_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ class DangerUtils {
static Future<String> spawn(String command,
{List<String> arguments = const []}) async {
final result = await Process.run(command, arguments, runInShell: true);

print("=======");
print('Exit code ${result.exitCode}');
print('stderr:');
print(result.stderr);
print('stdout:');
print(result.stdout);
print("=======");
return result.stdout.toString().trim();
}

Expand All @@ -22,9 +28,6 @@ class DangerUtils {

final data =
await DangerUtils.spawn('git', arguments: ['fetch', 'origin', base]);
print("=======");
print(data);
print("=======");
}

/// Get PR target branch based on git provider
Expand Down Expand Up @@ -60,10 +63,7 @@ class DangerUtils {
}

final data =
await DangerUtils.spawn('git', arguments: ['diff', 'HEAD', base]);
print("=======");
print(data);
print("=======");
await DangerUtils.spawn('git', arguments: ['diff', base, 'HEAD']);
return GitDiffParser.parse(data);
}
}

0 comments on commit 7f5bc14

Please sign in to comment.