@datatruck/cli 0.23.2 → 0.23.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.
|
@@ -37,7 +37,6 @@ exports.datatruckPackageRepositoryDefinition = {
|
|
|
37
37
|
items: {
|
|
38
38
|
type: "object",
|
|
39
39
|
additionalProperties: false,
|
|
40
|
-
required: ["include"],
|
|
41
40
|
properties: {
|
|
42
41
|
name: { type: "string" },
|
|
43
42
|
compress: {
|
|
@@ -184,14 +183,15 @@ class DatatruckRepository extends RepositoryAbstract_1.RepositoryAbstract {
|
|
|
184
183
|
const defaultsPack = {
|
|
185
184
|
name: "defaults",
|
|
186
185
|
compress: data.packageConfig?.compress ?? this.config.compress,
|
|
187
|
-
include: [],
|
|
188
186
|
};
|
|
189
|
-
const packs = [...configPacks
|
|
187
|
+
const packs = [defaultsPack, ...configPacks];
|
|
190
188
|
const defaultsPackIndex = packs.findIndex((p) => p === defaultsPack);
|
|
191
189
|
const stream = (0, fs_1.createWriteStreamPool)({
|
|
192
190
|
path: await this.mkTmpDir("files"),
|
|
193
191
|
onStreamPath: (key) => `files-${key}.txt`,
|
|
194
192
|
});
|
|
193
|
+
scanner.total++;
|
|
194
|
+
stream.writeLine(defaultsPackIndex, ".");
|
|
195
195
|
await scanner.start(async (entry) => {
|
|
196
196
|
let packIndex = configPacks.findIndex((pack) => (0, string_1.match)(entry.path, pack.include, pack.exclude));
|
|
197
197
|
if (packIndex === -1)
|
|
@@ -205,6 +205,10 @@ class DatatruckRepository extends RepositoryAbstract_1.RepositoryAbstract {
|
|
|
205
205
|
});
|
|
206
206
|
packIndex = packs.length - 1;
|
|
207
207
|
}
|
|
208
|
+
if (!stream.lines(packIndex)) {
|
|
209
|
+
scanner.total++;
|
|
210
|
+
stream.writeLine(packIndex, ".");
|
|
211
|
+
}
|
|
208
212
|
stream.writeLine(packIndex, entry.path);
|
|
209
213
|
return true;
|
|
210
214
|
});
|
package/config.schema.json
CHANGED
package/package.json
CHANGED
package/utils/cli.js
CHANGED
|
@@ -21,6 +21,8 @@ function renderSpinner(counter) {
|
|
|
21
21
|
}
|
|
22
22
|
exports.renderSpinner = renderSpinner;
|
|
23
23
|
function renderProgressBar(progress, size = 10, subprogress) {
|
|
24
|
+
if (progress > 100)
|
|
25
|
+
throw new Error(`Invalid progress value: ${progress}`);
|
|
24
26
|
const completeChar = "\u2588";
|
|
25
27
|
const incompleteChar = "\u2591";
|
|
26
28
|
const completedSize = Math.round((progress * size) / 100);
|