Добавлена проверка на наличие установленного git в системе

This commit is contained in:
Alexander Zhirov 2025-05-26 03:09:15 +03:00
parent a7676d5886
commit cc85cdec78
Signed by: alexander
GPG key ID: C8D8BE544A27C511
2 changed files with 13 additions and 1 deletions

View file

@ -1,6 +1,7 @@
module snag.lib.lib;
import std.regex;
import std.process;
bool isValidHash(string hash) {
auto hashPattern = ctRegex!r"^[a-fA-F0-9]{7}$";
@ -11,3 +12,8 @@ bool isValidEmail(string email) {
auto emailPattern = ctRegex!r"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$";
return !matchFirst(email, emailPattern).empty;
}
bool checkGit() {
auto result = execute(["which", "git"]);
return !result.status;
}