@c6fc/spellcraft 0.0.10 → 0.0.11
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 +1 -1
- package/src/index.js +11 -2
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -294,11 +294,20 @@ exports.SpellFrame = class SpellFrame {
|
|
|
294
294
|
}
|
|
295
295
|
|
|
296
296
|
async importSpellCraftModuleFromNpm(npmPackage, name = false) {
|
|
297
|
-
|
|
297
|
+
|
|
298
|
+
let packagePath;
|
|
299
|
+
|
|
300
|
+
try {
|
|
301
|
+
packagePath = fs.existsSync(this.getModulePackagePath(npmPackage));
|
|
302
|
+
} catch (e) {
|
|
303
|
+
packagePath = false;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
if (!packagePath) {
|
|
298
307
|
console.log(`[*] Attempting to install ${npmPackage.blue}...`);
|
|
299
308
|
|
|
300
309
|
const install = spawnSync(`npm`, ['install', '--save', npmPackage], {
|
|
301
|
-
cwd:
|
|
310
|
+
cwd: this.currentPackagePath,
|
|
302
311
|
stdio: 'inherit'
|
|
303
312
|
});
|
|
304
313
|
|