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

This commit is contained in:
Dominik Prokop 2019-10-16 08:04:24 +02:00 committed by Torkel Ödegaard
parent 6e7c18fc1c
commit 2e18930285

View File

@ -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)}`;