Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug report: flow environment list doesnt output anything #5583

Closed
brugh opened this issue Oct 20, 2023 · 2 comments
Closed

Bug report: flow environment list doesnt output anything #5583

brugh opened this issue Oct 20, 2023 · 2 comments
Assignees
Labels
Milestone

Comments

@brugh
Copy link

brugh commented Oct 20, 2023

Priority

(Medium) I'm annoyed but I'll live

Description

the v7.0.0 of m365 doesn't output any information when running

m365 flow environment list

When adding output -o text it outputs the correct information but no output option or -o json doesn't work.

changing line 21 in dist/m365/flow/commands/environment/environment-list.js from

            if (args.options.output !== 'json' && res.length > 0) {

to

            if (res.length > 0) {

fixes the issue

Steps to reproduce

m365 login -t browser
m365 flow environment list

Expected results

a list of json formatted environments

Actual results

no output at all

Diagnostics

No response

CLI for Microsoft 365 version

v7.0.0

nodejs version

v18.17.1

Operating system (environment)

Windows

Shell

PowerShell

cli doctor

No response

Additional Info

No response

@brugh brugh added the bug label Oct 20, 2023
@martinlingstuyl
Copy link
Contributor

Hi @brugh, thanks for bringing this to our attention, and for researching a fix to it as well. Would you like to submit a Pull Request for it?

@milanholemans
Copy link
Contributor

The correct resolution should be to move the logger.log (line 33) out of the if condition to line 34.
Let's make sure that we add an extra test so this doesn't happen again.

try {
const res = await odata.getAllItems<{ name: string, displayName: string; properties: { displayName: string } }>(`${this.resource}providers/Microsoft.ProcessSimple/environments?api-version=2016-11-01`);
if (args.options.output !== 'json' && res.length > 0) {
res.forEach(e => {
e.displayName = e.properties.displayName;
});
await logger.log(res);
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants