tsondb 0.20.8 → 0.20.9
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.
|
@@ -153,7 +153,10 @@ else {
|
|
|
153
153
|
const db = await createDB(config, config.validationOptions, true);
|
|
154
154
|
if (passedArguments.command.options?.check === true) {
|
|
155
155
|
debug(`running command: format --check`);
|
|
156
|
-
await db.checkFormat();
|
|
156
|
+
const result = await db.checkFormat();
|
|
157
|
+
if (!result) {
|
|
158
|
+
process.exitCode = 1;
|
|
159
|
+
}
|
|
157
160
|
}
|
|
158
161
|
else {
|
|
159
162
|
debug(`running command: format`);
|
package/dist/src/node/index.d.ts
CHANGED
|
@@ -137,7 +137,7 @@ export declare class TSONDB<T extends DefaultTSONDBTypes = DefaultTSONDBTypes> {
|
|
|
137
137
|
/**
|
|
138
138
|
* Checks if the data on disk is formatted according to the current in-memory representation.
|
|
139
139
|
*/
|
|
140
|
-
checkFormat(): Promise<
|
|
140
|
+
checkFormat(): Promise<boolean>;
|
|
141
141
|
/**
|
|
142
142
|
* Reloads the data from disk into memory.
|
|
143
143
|
*/
|
package/dist/src/node/index.js
CHANGED
|
@@ -306,11 +306,13 @@ export class TSONDB {
|
|
|
306
306
|
}, true);
|
|
307
307
|
if (counter === 0) {
|
|
308
308
|
console.log(styleText("green", "All data is formatted"));
|
|
309
|
+
return true;
|
|
309
310
|
}
|
|
310
311
|
else {
|
|
311
312
|
console.error(styleText("red", `${counter.toFixed()} formatting error${counter === 1 ? "" : "s"} found`, {
|
|
312
313
|
stream: stderr,
|
|
313
314
|
}));
|
|
315
|
+
return false;
|
|
314
316
|
}
|
|
315
317
|
}
|
|
316
318
|
/**
|