Skip to content

Commit

Permalink
Remove version name from dub.json
Browse files Browse the repository at this point in the history
Newer dub versions reject this key, so the value has been moved
directly into ver.d
  • Loading branch information
rushsteve1 committed Dec 20, 2024
1 parent d88bb67 commit 04ac8b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"copyright": "Copyright © 2023, Steven vanZyl",
"description": "A near drop-in replacement for rm that uses the trash bin",
"version": "19.0.0",
"versionName": "M. Bison",
"license": "MIT",
"name": "trash-d",
"homepage": "https://github.com/rushsteve1/trash-d",
Expand Down
8 changes: 3 additions & 5 deletions source/trash/ver.d
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ const string DUB_JSON = import("dub.json");
/// trash-d is versioned sequentially starting at 1
const int VER = version_from_json();

// This was originally extracted from the JSON as well
// but a Dub update didn't like that
/// Ever major release is given a new name
/// Names are based on video game bosses
const string VER_NAME = version_name_from_json();
const string VER_NAME = "M. Bison";

/// The full version string
const string VER_TEXT = format("trash-d version %s '%s'", VER, VER_NAME);
Expand All @@ -29,10 +31,6 @@ private int version_from_json() {
return DUB_JSON.parseJSON()["version"].str.split(".")[0].to!int;
}

private string version_name_from_json() {
return DUB_JSON.parseJSON()["versionName"].str;
}

private string copy_text_from_json() {
import std.range;
import std.array;
Expand Down

0 comments on commit 04ac8b9

Please sign in to comment.