@zokugun/artifact 0.6.2 → 0.6.3
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/lib/steps/read-files.js
CHANGED
|
@@ -8,17 +8,14 @@ const path_1 = __importDefault(require("path"));
|
|
|
8
8
|
const cli_utils_1 = require("@zokugun/cli-utils");
|
|
9
9
|
const async_1 = __importDefault(require("@zokugun/fs-extra-plus/async"));
|
|
10
10
|
const xtry_1 = require("@zokugun/xtry");
|
|
11
|
-
const globby_1 = __importDefault(require("globby"));
|
|
12
11
|
const istextorbinary_1 = require("istextorbinary");
|
|
13
12
|
const detect_indent_js_1 = require("../utils/detect-indent.js");
|
|
14
13
|
const has_final_new_line_js_1 = require("../utils/has-final-new-line.js");
|
|
14
|
+
const list_working_files_js_1 = require("../utils/list-working-files.js");
|
|
15
15
|
const read_buffer_js_1 = require("../utils/read-buffer.js");
|
|
16
16
|
async function readFiles({ incomingPath, textFiles, binaryFiles, options }) {
|
|
17
17
|
const cwd = path_1.default.join(incomingPath, 'configs');
|
|
18
|
-
const files = await (0,
|
|
19
|
-
cwd,
|
|
20
|
-
dot: true,
|
|
21
|
-
});
|
|
18
|
+
const files = await (0, list_working_files_js_1.listWorkingFiles)(cwd);
|
|
22
19
|
for (const file of files) {
|
|
23
20
|
const filePath = path_1.default.join(cwd, file);
|
|
24
21
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
@@ -8,17 +8,14 @@ const path_1 = __importDefault(require("path"));
|
|
|
8
8
|
const cli_utils_1 = require("@zokugun/cli-utils");
|
|
9
9
|
const async_1 = __importDefault(require("@zokugun/fs-extra-plus/async"));
|
|
10
10
|
const xtry_1 = require("@zokugun/xtry");
|
|
11
|
-
const globby_1 = __importDefault(require("globby"));
|
|
12
11
|
const micromatch_1 = require("micromatch");
|
|
12
|
+
const list_working_files_js_1 = require("../utils/list-working-files.js");
|
|
13
13
|
async function removeFiles({ removedPatterns, targetPath, options }) {
|
|
14
14
|
if (removedPatterns.length === 0) {
|
|
15
15
|
return xtry_1.OK;
|
|
16
16
|
}
|
|
17
17
|
const cwd = path_1.default.join(targetPath);
|
|
18
|
-
const files = await (0,
|
|
19
|
-
cwd,
|
|
20
|
-
dot: true,
|
|
21
|
-
});
|
|
18
|
+
const files = await (0, list_working_files_js_1.listWorkingFiles)(cwd);
|
|
22
19
|
for (const file of files) {
|
|
23
20
|
if ((0, micromatch_1.isMatch)(file, removedPatterns)) {
|
|
24
21
|
if (!options.dryRun) {
|
|
@@ -9,19 +9,16 @@ const cli_utils_1 = require("@zokugun/cli-utils");
|
|
|
9
9
|
const async_1 = __importDefault(require("@zokugun/fs-extra-plus/async"));
|
|
10
10
|
const is_it_type_1 = require("@zokugun/is-it-type");
|
|
11
11
|
const xtry_1 = require("@zokugun/xtry");
|
|
12
|
-
const globby_1 = __importDefault(require("globby"));
|
|
13
12
|
const index_js_1 = require("../journeys/index.js");
|
|
14
13
|
const detect_indent_js_1 = require("../utils/detect-indent.js");
|
|
15
14
|
const has_final_new_line_js_1 = require("../utils/has-final-new-line.js");
|
|
15
|
+
const list_working_files_js_1 = require("../utils/list-working-files.js");
|
|
16
16
|
async function transformUntouchedFiles({ formats, options, routes, targetPath, textFiles, transformedFiles, transforms }) {
|
|
17
17
|
if (transforms.length === 0) {
|
|
18
18
|
return xtry_1.OK;
|
|
19
19
|
}
|
|
20
20
|
const cwd = path_1.default.join(targetPath);
|
|
21
|
-
const files = await (0,
|
|
22
|
-
cwd,
|
|
23
|
-
dot: true,
|
|
24
|
-
});
|
|
21
|
+
const files = await (0, list_working_files_js_1.listWorkingFiles)(cwd);
|
|
25
22
|
for (const file of files) {
|
|
26
23
|
if (textFiles.some(({ name }) => name === file)) {
|
|
27
24
|
continue;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function listWorkingFiles(cwd: string): Promise<string[]>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.listWorkingFiles = listWorkingFiles;
|
|
7
|
+
const globby_1 = __importDefault(require("globby"));
|
|
8
|
+
async function listWorkingFiles(cwd) {
|
|
9
|
+
return (0, globby_1.default)(['**/*', '!**/*.lock', '!**/*-lock.*', '!.git', '!**/node_modules/**'], {
|
|
10
|
+
cwd,
|
|
11
|
+
dot: true,
|
|
12
|
+
followSymbolicLinks: false,
|
|
13
|
+
});
|
|
14
|
+
}
|