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


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


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


Loading…
Cancel
Save