getGitLastCommitHash function

Future<String> getGitLastCommitHash(
  1. String root
)

获取本地代码最新的哈希

Implementation

Future<String> getGitLastCommitHash(String root) async {
  final result = await runCommand(
    root,
    'git log -n 1 --pretty=format:"%H"',
    ignoreError: true,
  );
  return result.first.stdout.toString().trim();
}