Get the current git user based on the git config.
(git: GitClient)
| 120 | |
| 121 | /** Get the current git user based on the git config. */ |
| 122 | function getCurrentGitUser(git: GitClient) { |
| 123 | try { |
| 124 | let userName = git.runGraceful(['config', 'user.name']).stdout.trim() || 'Unknown User'; |
| 125 | let userEmail = git.runGraceful(['config', 'user.email']).stdout.trim() || 'unknown_email'; |
| 126 | return `${userName} <${userEmail}>`; |
| 127 | } catch { |
| 128 | return ''; |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | /** Gets the `version` from the workspace top-level `package.json` file. */ |
| 133 | function getVersionFromWorkspacePackageJson(git: GitClient): semver.SemVer { |
no test coverage detected