diff --git a/README.en.md b/README.en.md index 6a217e0..622616c 100644 --- a/README.en.md +++ b/README.en.md @@ -93,7 +93,7 @@ snag restore [-h] [--no-pre] [--no-post] ``` - `--no-pre` — Skips pre-commands. -- `--no-post` — Skips post-commands. +- `--no-post` —焦性 - `` — Hash of the snapshot to restore. ### `snag list` diff --git a/source/app.d b/source/app.d index d952688..a79b3f8 100644 --- a/source/app.d +++ b/source/app.d @@ -237,9 +237,7 @@ int main(string[] args) return EXIT_FAILURE; } catch (Exception e) { writeln( - "AN UNEXPECTED ERROR HAS OCCURRED!\n", - "PLEASE REPORT IT TO THE AUTHOR OF THE SNAG: ", - "alexander@zhirov.kz (Alexander Zhirov)\n\n", + "AN UNEXPECTED ERROR HAS OCCURRED! PLEASE REPORT IT TO THE AUTHOR OF THE SNAG!\n\n", e ); return EXIT_FAILURE; diff --git a/source/snag/core/core.d b/source/snag/core/core.d index 4196481..9917240 100644 --- a/source/snag/core/core.d +++ b/source/snag/core/core.d @@ -22,8 +22,8 @@ class Snag { this(SnagConfig config) { _baseCommand = format( - "git -C %s --git-dir=%s --work-tree=%s", - config.project, config.git, config.project + "git --git-dir=%s --work-tree=%s", + config.git, config.project ).split(); _config = config; @@ -131,7 +131,7 @@ class Snag { } writeln("The following list of files requires backup:"); result.output.split('\n')[0..$-1].map!(e => - e.strip.splitByFirstSpace + e.strip.split ).each!(e => writefln("\t%s\t/%s", gitStatus(e[0], true), e[1]) ); @@ -250,7 +250,7 @@ class Snag { [ "log", "--all", - "--date=format:%Y.%m.%d %H:%M:%S", + "--date=format:%Y.%m.%d %H:%M", "--pretty=" ~ format ], "Failed to retrieve the list of snapshots" @@ -381,8 +381,8 @@ class Snag { // Выполнение git команд относительно распакованного архива string[] customCommand = format( - "git -C %s --git-dir=%s --work-tree=%s", - tempDirectory, _config.git, tempDirectory + "git --git-dir=%s --work-tree=%s", + _config.git, tempDirectory ).split(); // Необходимо проверить, что текущее состояние файлов не идентично файлам распакованного архива diff --git a/source/snag/core/rules.d b/source/snag/core/rules.d index 85fca40..d8a2c9c 100644 --- a/source/snag/core/rules.d +++ b/source/snag/core/rules.d @@ -75,8 +75,8 @@ class SnagRules { _gitignoreBak = _gitignore ~ ".bak"; _baseCommand = format( - "git -C %s --git-dir=%s --work-tree=%s", - config.project, config.git, config.project + "git --git-dir=%s --work-tree=%s", + config.git, config.project ).split(); generate(); diff --git a/source/snag/lib/lib.d b/source/snag/lib/lib.d index 6db6056..902691d 100644 --- a/source/snag/lib/lib.d +++ b/source/snag/lib/lib.d @@ -2,8 +2,6 @@ module snag.lib.lib; import std.regex; import std.process; -import std.algorithm; -import std.string; bool isValidHash(string hash) { auto hashPattern = ctRegex!r"^[a-fA-F0-9]{7}$"; @@ -19,9 +17,3 @@ bool checkGit() { auto result = execute(["which", "git"]); return !result.status; } - -string[] splitByFirstSpace(string line) { - auto spaceIndex = line.indexOf(' '); - return spaceIndex == -1 ? - [line] : [line[0 .. spaceIndex], line[spaceIndex + 1..$]]; -} diff --git a/source/snag/version_.d b/source/snag/version_.d index 5f8c518..3dcb82b 100644 --- a/source/snag/version_.d +++ b/source/snag/version_.d @@ -1,3 +1,3 @@ module snag.version_; -enum snagVersion = "0.1.0-alpha.2"; +enum snagVersion = "0.1.0-alpha.1";