node-sword-interface 0.252.0 → 0.253.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -142,9 +142,9 @@ NodeSwordInterface::NodeSwordInterface(const Napi::CallbackInfo& info) : Napi::O
|
|
|
142
142
|
Napi::Env env = info.Env();
|
|
143
143
|
Napi::HandleScope scope(env);
|
|
144
144
|
|
|
145
|
-
std::string customHomeDir = "";
|
|
146
145
|
std::string localeDir = "";
|
|
147
|
-
|
|
146
|
+
this->customHomeDir = "";
|
|
147
|
+
|
|
148
148
|
bool homeDirError = false;
|
|
149
149
|
bool localeDirError = false;
|
|
150
150
|
|
|
@@ -153,9 +153,9 @@ NodeSwordInterface::NodeSwordInterface(const Napi::CallbackInfo& info) : Napi::O
|
|
|
153
153
|
this->_currentModuleSearchWorker = 0;
|
|
154
154
|
|
|
155
155
|
if (info[0].IsString()) {
|
|
156
|
-
customHomeDir = string(info[0].As<Napi::String>());
|
|
156
|
+
this->customHomeDir = string(info[0].As<Napi::String>());
|
|
157
157
|
|
|
158
|
-
if (!this->dirExists(info, customHomeDir)) {
|
|
158
|
+
if (!this->dirExists(info, this->customHomeDir)) {
|
|
159
159
|
homeDirError = true;
|
|
160
160
|
}
|
|
161
161
|
}
|
|
@@ -171,10 +171,10 @@ NodeSwordInterface::NodeSwordInterface(const Napi::CallbackInfo& info) : Napi::O
|
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
if (!homeDirError && !localeDirError) { // We only proceed if there has not been any issue with the homeDir or localeDir
|
|
174
|
-
this->_moduleStore = new ModuleStore(customHomeDir);
|
|
174
|
+
this->_moduleStore = new ModuleStore(this->customHomeDir);
|
|
175
175
|
this->_moduleHelper = new ModuleHelper(*(this->_moduleStore));
|
|
176
|
-
this->_repoInterface = new RepositoryInterface(this->_swordStatusReporter, *(this->_moduleHelper), customHomeDir);
|
|
177
|
-
this->_moduleInstaller = new ModuleInstaller(*(this->_repoInterface), *(this->_moduleStore), customHomeDir);
|
|
176
|
+
this->_repoInterface = new RepositoryInterface(this->_swordStatusReporter, *(this->_moduleHelper), this->customHomeDir);
|
|
177
|
+
this->_moduleInstaller = new ModuleInstaller(*(this->_repoInterface), *(this->_moduleStore), this->customHomeDir);
|
|
178
178
|
this->_napiSwordHelper = new NapiSwordHelper(*(this->_moduleHelper), *(this->_moduleStore));
|
|
179
179
|
this->_textProcessor = new TextProcessor(*(this->_moduleStore), *(this->_moduleHelper));
|
|
180
180
|
this->_moduleSearch = new ModuleSearch(*(this->_moduleStore), *(this->_moduleHelper), *(this->_textProcessor));
|
|
@@ -952,6 +952,10 @@ Napi::Value NodeSwordInterface::getSwordPath(const Napi::CallbackInfo& info)
|
|
|
952
952
|
Napi::HandleScope scope(env);
|
|
953
953
|
|
|
954
954
|
FileSystemHelper fsHelper;
|
|
955
|
+
if (this->customHomeDir != "") {
|
|
956
|
+
fsHelper.setCustomHomeDir(customHomeDir);
|
|
957
|
+
}
|
|
958
|
+
|
|
955
959
|
Napi::String swordPath = Napi::String::New(env, fsHelper.getUserSwordDir());
|
|
956
960
|
unlockApi();
|
|
957
961
|
return swordPath;
|