Добавлен новый параметр user для конфигурации git
This commit is contained in:
parent
dad3d356c6
commit
cf85cc3c77
1 changed files with 14 additions and 0 deletions
|
@ -12,6 +12,7 @@ class SnapdConfig {
|
||||||
private string _git;
|
private string _git;
|
||||||
private string _project;
|
private string _project;
|
||||||
private string _email;
|
private string _email;
|
||||||
|
private string _user;
|
||||||
|
|
||||||
private bool isValidEmail(string email) {
|
private bool isValidEmail(string email) {
|
||||||
auto emailPattern = ctRegex!r"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$";
|
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"
|
"Invalid email address provided in the \"email\" parameter:\n\t"
|
||||||
~ _email
|
~ _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 git() const { return _git; }
|
||||||
@property string project() const { return _project; }
|
@property string project() const { return _project; }
|
||||||
@property string email() const { return _email; }
|
@property string email() const { return _email; }
|
||||||
|
@property string user() const { return _user; }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue