Skip to content

Commit 81a16ad

Browse files
committed
Automatically set Core plugin version to Rack app version.
1 parent 61c01ab commit 81a16ad

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Core.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"slug": "Core",
33
"name": "VCV Core",
4-
"version": "2.6.0",
54
"license": "GPL-3.0-or-later",
65
"author": "VCV",
76
"brand": "VCV",

src/plugin.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,11 @@ static Plugin* loadPlugin(std::string path) {
133133
INFO("Loading plugin from %s", path.c_str());
134134

135135
Plugin* plugin = new Plugin;
136+
136137
try {
138+
if (path == "")
139+
plugin->version = APP_VERSION;
140+
137141
// Set plugin path
138142
plugin->path = (path == "") ? asset::systemDir : path;
139143

src/plugin/Plugin.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ void Plugin::fromJson(json_t* rootJ) {
4848
json_t* versionJ = json_object_get(rootJ, "version");
4949
if (versionJ)
5050
version = json_string_value(versionJ);
51-
if (!string::startsWith(version, APP_VERSION_MAJOR + "."))
52-
throw Exception("Plugin version %s does not match Rack ABI version %s", version.c_str(), APP_VERSION_MAJOR.c_str());
5351
if (version == "")
5452
throw Exception("No plugin version");
53+
if (!string::startsWith(version, APP_VERSION_MAJOR + "."))
54+
throw Exception("Plugin version %s does not match Rack ABI version %s", version.c_str(), APP_VERSION_MAJOR.c_str());
5555

5656
// name
5757
json_t* nameJ = json_object_get(rootJ, "name");

0 commit comments

Comments
 (0)