jizy-packer 2.1.19 → 2.1.20
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/package.json.skel +1 -1
- package/cli/init.js +8 -9
- package/package.json +1 -1
- package/_package/cli/jpack.js.skel +0 -3
package/cli/init.js
CHANGED
|
@@ -11,22 +11,21 @@ async function copyAndReplace(srcDir, destDir, replacements) {
|
|
|
11
11
|
const destPath = path.join(destDir, destName);
|
|
12
12
|
|
|
13
13
|
if (fs.existsSync(destPath)) {
|
|
14
|
-
if (entry.name
|
|
15
|
-
// read json file and check if the name of the package is set
|
|
16
|
-
const pkg = JSON.parse(fs.readFileSync(srcPath, "utf8"));
|
|
17
|
-
if (pkg.name) {
|
|
18
|
-
continue; // skip existing package.json with name set
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
14
|
+
if (entry.name !== 'package.json') {
|
|
22
15
|
continue; // Skip existing files & folders
|
|
23
16
|
}
|
|
17
|
+
|
|
18
|
+
// read json file and check if the name of the package is set
|
|
19
|
+
const pkg = JSON.parse(fs.readFileSync(srcPath, "utf8"));
|
|
20
|
+
if (pkg.name) {
|
|
21
|
+
continue; // skip existing package.json with name set
|
|
22
|
+
}
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
if (entry.isDirectory()) {
|
|
27
26
|
if (!fs.existsSync(destPath)) fs.mkdirSync(destPath);
|
|
28
27
|
await copyAndReplace(srcPath, destPath, replacements);
|
|
29
|
-
|
|
28
|
+
continue;
|
|
30
29
|
}
|
|
31
30
|
|
|
32
31
|
let content = fs.readFileSync(srcPath, "utf8");
|
package/package.json
CHANGED