trm-client 7.4.1 → 7.4.2
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/changelog.txt +4 -0
- package/dist/utils/GlobalContext.js +7 -5
- package/package.json +1 -1
package/changelog.txt
CHANGED
|
@@ -173,12 +173,14 @@ class GlobalContext {
|
|
|
173
173
|
}
|
|
174
174
|
setGlobalNpmPathInternal() {
|
|
175
175
|
const globalNpmPathCache = this._cache.globalNpmPath;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
trm_commons_1.Logger.log(`Npm global modules path set to ${path}`, true);
|
|
180
|
-
this.setCache('globalNpmPath', path);
|
|
176
|
+
const isValid = !!globalNpmPathCache && !!globalNpmPathCache.ts && (Date.now() - globalNpmPathCache.ts) < this.getSettings().npmGlobalPathCheckCache * 1000;
|
|
177
|
+
if (isValid) {
|
|
178
|
+
return globalNpmPathCache.data;
|
|
181
179
|
}
|
|
180
|
+
trm_commons_1.Logger.loading(`Cache expired, setting npm global modules path...`, true);
|
|
181
|
+
const path = (0, trm_commons_1.getGlobalNodeModules)();
|
|
182
|
+
trm_commons_1.Logger.log(`Npm global modules path set to ${path}`, true);
|
|
183
|
+
this.setCache('globalNpmPath', path);
|
|
182
184
|
}
|
|
183
185
|
getSettingsInternal() {
|
|
184
186
|
const defaultSettings = this.getDefaultSettings();
|