Browse Source

Create plugins/ directory on startup

tags/v0.4.0^2
Andrew Belt 7 years ago
parent
commit
aa133088cd
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      src/plugin.cpp

+ 3
- 1
src/plugin.cpp View File

@@ -213,7 +213,6 @@ static void refreshPurchase(json_t *pluginJ) {

// Download zip
std::string pluginsDir = assetLocal("plugins");
mkdir(pluginsDir.c_str(), 0755);
std::string filename = pluginsDir + "/" + slug + ".zip";
bool success = requestDownload(url, filename, &downloadProgress);
if (success) {
@@ -243,10 +242,13 @@ void pluginInit() {

// Load plugins from global directory
std::string globalPlugins = assetGlobal("plugins");
printf("Loading plugins from %s\n", globalPlugins.c_str());
loadPlugins(globalPlugins);

// Load plugins from local directory
std::string localPlugins = assetLocal("plugins");
mkdir(localPlugins.c_str(), 0755);
printf("Loading plugins from %s\n", localPlugins.c_str());
if (globalPlugins != localPlugins)
loadPlugins(localPlugins);
}


Loading…
Cancel
Save