Добавлен новый параметр user для конфигурации git

This commit is contained in:
Alexander Zhirov 2025-05-24 01:33:42 +03:00
parent dad3d356c6
commit cf85cc3c77
Signed by: alexander
GPG key ID: C8D8BE544A27C511

View file

@ -12,6 +12,7 @@ class SnapdConfig {
private string _git;
private string _project;
private string _email;
private string _user;
private bool isValidEmail(string email) {
auto emailPattern = ctRegex!r"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$";
@ -85,9 +86,22 @@ class SnapdConfig {
"Invalid email address provided in the \"email\" parameter:\n\t"
~ _email
);
if ("user" !in jsonData)
throw new SnapdConfigException(
"The configuration file is missing the \"user\" parameter"
);
_user = jsonData["user"].str;
if (!_user.length)
throw new SnapdConfigException(
"The \"user\" parameter must contain an user name"
);
}
@property string git() const { return _git; }
@property string project() const { return _project; }
@property string email() const { return _email; }
@property string user() const { return _user; }
}