Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Sep 5, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/util/azure/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,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`;
}

Expand Down