@jtff/miztemplate-lib 3.0.6 → 3.0.7

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.
Files changed (2) hide show
  1. package/lib/mizlib.js +15 -2
  2. package/package.json +1 -1
package/lib/mizlib.js CHANGED
@@ -42,6 +42,18 @@ class Mizlib {
42
42
  colorString
43
43
  );
44
44
  for (let luaScript of luaScriptsArray) {
45
+ if (! fs.existsSync([
46
+ workspacePath,
47
+ fromLibrary ? "/.workspace/" : "/",
48
+ folderPath,
49
+ ].join("")
50
+ )) {
51
+ fs.mkdirSync([
52
+ workspacePath,
53
+ fromLibrary ? "/.workspace/" : "/",
54
+ folderPath,
55
+ ].join(""));
56
+ }
45
57
  fs.copyFileSync(
46
58
  [
47
59
  getInstalledPathSync('@jtff/miztemplate-lib',{local: true}),
@@ -328,13 +340,14 @@ class Mizlib {
328
340
  }
329
341
 
330
342
  copyRecursiveSync(src, dest) {
343
+ let self = this;
331
344
  let exists = fs.existsSync(src);
332
345
  let stats = exists && fs.statSync(src);
333
346
  let isDirectory = exists && stats.isDirectory();
334
347
  if (isDirectory) {
335
- fs.mkdirSync(dest);
348
+ fs.mkdirSync(dest, {recursive: true});
336
349
  fs.readdirSync(src).forEach(function(childItemName) {
337
- copyRecursiveSync(path.join(src, childItemName),
350
+ self.copyRecursiveSync(path.join(src, childItemName),
338
351
  path.join(dest, childItemName));
339
352
  });
340
353
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jtff/miztemplate-lib",
3
- "version": "3.0.6",
3
+ "version": "3.0.7",
4
4
  "description": "JTFF mission template library",
5
5
  "main": "index.js",
6
6
  "files": [