Skip to content

Commit

Permalink
fix(json): disable pretty printing in json mode
Browse files Browse the repository at this point in the history
  • Loading branch information
azlam-abdulsalam committed Aug 7, 2023
1 parent 1b65439 commit 2fa6cf6
Show file tree
Hide file tree
Showing 4 changed files with 12,431 additions and 16,919 deletions.
1 change: 1 addition & 0 deletions packages/sfpowerscripts-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"ajv": "8.11.0",
"async-retry": "^1.3.1",
"bottleneck": "^2.19.5",
"chalk": "^4.1.2",
"cli-table": "0.3.11",
"dotenv": "16.3.1",
"fs-extra": "^11.1.1",
Expand Down
8 changes: 7 additions & 1 deletion packages/sfpowerscripts-cli/src/SfpowerscriptsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ProjectValidation from './ProjectValidation';
import * as fs from 'fs-extra';
import SFPLogger, { COLOR_HEADER, ConsoleLogger, LoggerLevel } from '@dxatscale/sfp-logger';
import GroupConsoleLogs from './ui/GroupConsoleLogs';
import { Command, Flags } from '@oclif/core';
import { Command, Flags, ux } from '@oclif/core';
import { FlagOutput } from '@oclif/core/lib/interfaces/parser';
import { Org } from '@salesforce/core';

Expand Down Expand Up @@ -117,6 +117,12 @@ export default abstract class SfpowerscriptsCommand extends Command {
)
);
}
else
{
//Disable pretty printing in json mode
const chalk = require('chalk')
chalk.level = 0;
}

if (this.statics.requiresProject) {
let projectValidation = new ProjectValidation();
Expand Down
4 changes: 2 additions & 2 deletions packages/sfpowerscripts-cli/src/commands/pool/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default class List extends SfpowerscriptsCommand {
loglevel
};

public async execute(): Promise<AnyJson> {
public async execute(): Promise<any> {
await this.hubOrg.refreshAuth();
const hubConn = this.hubOrg.getConnection();

Expand Down Expand Up @@ -98,7 +98,7 @@ export default class List extends SfpowerscriptsCommand {
}
}

let output: any = {
let output = {
total: scratchOrgInuse.length + scratchOrgNotInuse.length + scratchOrgInProvision.length,
inuse: scratchOrgInuse.length,
unused: scratchOrgNotInuse.length,
Expand Down
Loading

0 comments on commit 2fa6cf6

Please sign in to comment.