@grafana/toolkit: Check if git user.name config is set (#19821)

(cherry picked from commit 2e18930285)
This commit is contained in:
Dominik Prokop
2019-10-16 12:32:09 +03:00
committed by Sofia Papagiannaki
parent 399dd583da
commit 90fe6c5a9f
@@ -29,7 +29,10 @@ const RepositoriesPaths = {
'datasource-plugin': 'https://github.com/grafana/simple-datasource.git',
};
export const getGitUsername = async () => await simpleGit.raw(['config', '--global', 'user.name']);
export const getGitUsername = async () => {
const name = await simpleGit.raw(['config', '--global', 'user.name']);
return name || '';
};
export const getPluginIdFromName = (name: string) => kebabCase(name);
export const getPluginId = (pluginDetails: PluginDetails) =>
`${kebabCase(pluginDetails.org)}-${getPluginIdFromName(pluginDetails.name)}`;