Skip to content

Commit 03e901c

Browse files
store/cockpit: pretty print saved json files
This is not strictly needed, it just makes life a little easier.
1 parent 7df1956 commit 03e901c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/store/cockpit/cockpitApi.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export const cockpitApi = contentSourcesApi.injectEndpoints({
205205
);
206206
await cockpit
207207
.file(path.join(blueprintsDir, id, `${id}.json`))
208-
.replace(JSON.stringify(blueprintReq));
208+
.replace(JSON.stringify(blueprintReq, null, 2));
209209
return {
210210
data: {
211211
id: id,
@@ -225,7 +225,7 @@ export const cockpitApi = contentSourcesApi.injectEndpoints({
225225
const blueprintsDir = await getBlueprintsPath();
226226
await cockpit
227227
.file(path.join(blueprintsDir, id, `${id}.json`))
228-
.replace(JSON.stringify(blueprintReq));
228+
.replace(JSON.stringify(blueprintReq, null, 2));
229229
return {
230230
data: {
231231
id: id,
@@ -397,6 +397,8 @@ export const cockpitApi = contentSourcesApi.injectEndpoints({
397397
crcComposeRequest.distribution,
398398
[ir],
399399
),
400+
null,
401+
2,
400402
),
401403
headers: {
402404
'content-type': 'application/json',
@@ -405,7 +407,7 @@ export const cockpitApi = contentSourcesApi.injectEndpoints({
405407

406408
await cockpit
407409
.file(path.join(blueprintsDir, filename, composeResp.data?.id))
408-
.replace(JSON.stringify(crcComposeRequest));
410+
.replace(JSON.stringify(crcComposeRequest, null, 2));
409411
composes.push({ id: composeResp.data?.id });
410412
}
411413

0 commit comments

Comments
 (0)