@create-node-app/core 0.3.12 → 0.3.13
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/dist/index.js +10 -7
- package/dist/index.mjs +10 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7299,7 +7299,8 @@ var batchedWriteFiles = async (operations) => {
|
|
|
7299
7299
|
try {
|
|
7300
7300
|
makeDirectory((0, import_path3.dirname)(operation.path));
|
|
7301
7301
|
await writeFileAsync(operation.path, operation.content, {
|
|
7302
|
-
flag: operation.flag
|
|
7302
|
+
flag: operation.flag,
|
|
7303
|
+
mode: operation.mode
|
|
7303
7304
|
});
|
|
7304
7305
|
if (operation.verbose) {
|
|
7305
7306
|
console.log(import_chalk2.default.green(`Added "${operation.path}" successfully`));
|
|
@@ -7318,12 +7319,14 @@ var batchedAppendFiles = async (operations) => {
|
|
|
7318
7319
|
const batchedPromises = operations.map(async (operation) => {
|
|
7319
7320
|
try {
|
|
7320
7321
|
const content = await (0, import_util.promisify)(import_fs4.default.readFile)(operation.src, "utf8");
|
|
7322
|
+
const fileMode = (await (0, import_util.promisify)(import_fs4.default.stat)(operation.src)).mode;
|
|
7321
7323
|
await batchedWriteFiles([
|
|
7322
7324
|
{
|
|
7323
7325
|
path: operation.dest,
|
|
7324
7326
|
content,
|
|
7325
7327
|
flag: "a+",
|
|
7326
|
-
verbose: operation.verbose
|
|
7328
|
+
verbose: operation.verbose,
|
|
7329
|
+
mode: fileMode
|
|
7327
7330
|
}
|
|
7328
7331
|
]);
|
|
7329
7332
|
} catch (err) {
|
|
@@ -7386,10 +7389,9 @@ var templateLoader = ({
|
|
|
7386
7389
|
const operations = [];
|
|
7387
7390
|
try {
|
|
7388
7391
|
const flag = mode.includes("append") ? "a+" : "w";
|
|
7389
|
-
const
|
|
7390
|
-
|
|
7391
|
-
|
|
7392
|
-
);
|
|
7392
|
+
const filePath = `${templateDir}/${path4}`;
|
|
7393
|
+
const file = await (0, import_util.promisify)(import_fs4.default.readFile)(filePath, "utf8");
|
|
7394
|
+
const fileMode = (await (0, import_util.promisify)(import_fs4.default.stat)(filePath)).mode;
|
|
7393
7395
|
const newFile = import_underscore.default.template(file);
|
|
7394
7396
|
const newPath = path4.replace(/.template$/, "").replace(/.append$/, "").replace(/.if-(npm|yarn|pnpm)$/, "").replace(SRC_PATH_PATTERN, getSrcDirPattern(srcDir));
|
|
7395
7397
|
operations.push({
|
|
@@ -7402,7 +7404,8 @@ var templateLoader = ({
|
|
|
7402
7404
|
...customOptions
|
|
7403
7405
|
}),
|
|
7404
7406
|
flag,
|
|
7405
|
-
verbose
|
|
7407
|
+
verbose,
|
|
7408
|
+
mode: fileMode
|
|
7406
7409
|
});
|
|
7407
7410
|
} catch (err) {
|
|
7408
7411
|
if (verbose) {
|
package/dist/index.mjs
CHANGED
|
@@ -7292,7 +7292,8 @@ var batchedWriteFiles = async (operations) => {
|
|
|
7292
7292
|
try {
|
|
7293
7293
|
makeDirectory(dirname(operation.path));
|
|
7294
7294
|
await writeFileAsync(operation.path, operation.content, {
|
|
7295
|
-
flag: operation.flag
|
|
7295
|
+
flag: operation.flag,
|
|
7296
|
+
mode: operation.mode
|
|
7296
7297
|
});
|
|
7297
7298
|
if (operation.verbose) {
|
|
7298
7299
|
console.log(chalk2.green(`Added "${operation.path}" successfully`));
|
|
@@ -7311,12 +7312,14 @@ var batchedAppendFiles = async (operations) => {
|
|
|
7311
7312
|
const batchedPromises = operations.map(async (operation) => {
|
|
7312
7313
|
try {
|
|
7313
7314
|
const content = await promisify(fs3.readFile)(operation.src, "utf8");
|
|
7315
|
+
const fileMode = (await promisify(fs3.stat)(operation.src)).mode;
|
|
7314
7316
|
await batchedWriteFiles([
|
|
7315
7317
|
{
|
|
7316
7318
|
path: operation.dest,
|
|
7317
7319
|
content,
|
|
7318
7320
|
flag: "a+",
|
|
7319
|
-
verbose: operation.verbose
|
|
7321
|
+
verbose: operation.verbose,
|
|
7322
|
+
mode: fileMode
|
|
7320
7323
|
}
|
|
7321
7324
|
]);
|
|
7322
7325
|
} catch (err) {
|
|
@@ -7379,10 +7382,9 @@ var templateLoader = ({
|
|
|
7379
7382
|
const operations = [];
|
|
7380
7383
|
try {
|
|
7381
7384
|
const flag = mode.includes("append") ? "a+" : "w";
|
|
7382
|
-
const
|
|
7383
|
-
|
|
7384
|
-
|
|
7385
|
-
);
|
|
7385
|
+
const filePath = `${templateDir}/${path4}`;
|
|
7386
|
+
const file = await promisify(fs3.readFile)(filePath, "utf8");
|
|
7387
|
+
const fileMode = (await promisify(fs3.stat)(filePath)).mode;
|
|
7386
7388
|
const newFile = _.template(file);
|
|
7387
7389
|
const newPath = path4.replace(/.template$/, "").replace(/.append$/, "").replace(/.if-(npm|yarn|pnpm)$/, "").replace(SRC_PATH_PATTERN, getSrcDirPattern(srcDir));
|
|
7388
7390
|
operations.push({
|
|
@@ -7395,7 +7397,8 @@ var templateLoader = ({
|
|
|
7395
7397
|
...customOptions
|
|
7396
7398
|
}),
|
|
7397
7399
|
flag,
|
|
7398
|
-
verbose
|
|
7400
|
+
verbose,
|
|
7401
|
+
mode: fileMode
|
|
7399
7402
|
});
|
|
7400
7403
|
} catch (err) {
|
|
7401
7404
|
if (verbose) {
|