fix: lowercase and max account name to adhere to Azure rules (#63)

* fixing lowercase and max account name to adhere to Azure rules

* fix: fixing lowercase and max account name to adhere to Azure rules
This commit is contained in:
chris 2019-09-05 13:17:21 +01:00 коммит произвёл Wassim Chegham
Родитель 49b8f675b5
Коммит c0bba39518
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -41,7 +41,13 @@ export async function getAccount(
function getInitialAccountName() {
const normalizedProjectNameArray = options.project.match(/[a-zA-Z0-9]/g);
const normalizedProjectName = normalizedProjectNameArray ? normalizedProjectNameArray.join('') : '';
let normalizedProjectName = normalizedProjectNameArray ? normalizedProjectNameArray.join('') : '';
/*
ensures project name + 'static' does not overshoot 24 characters (which is the Azure requirement on an account name)
additionally it needs to be lowercase (in case we have Angular project like e.g `ExampleApp`)
*/
normalizedProjectName = normalizedProjectName.toLowerCase().substring(0, 18);
return `${normalizedProjectName}static`;
}