fix: avoid generating names in an infinite loop (#62)
* without this fix it will keep generating names for all eternity * fix: without this fix it will keep generating names for all eternity
This commit is contained in:
Родитель
c0bba39518
Коммит
192f38bc21
|
@ -106,10 +106,11 @@ function checkNameAvailability(client: StorageManagementClient, warn?: boolean)
|
||||||
const availability = await client.storageAccounts.checkNameAvailability(account);
|
const availability = await client.storageAccounts.checkNameAvailability(account);
|
||||||
if (!availability.nameAvailable && warn) {
|
if (!availability.nameAvailable && warn) {
|
||||||
spinner.fail(availability.message || 'chosen name is not available');
|
spinner.fail(availability.message || 'chosen name is not available');
|
||||||
|
return false;
|
||||||
} else {
|
} else {
|
||||||
spinner.stop();
|
spinner.stop();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return !!availability.nameAvailable;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче