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

feat: env open @W-9104301@ #31

Merged
merged 8 commits into from
Jun 4, 2021
Merged

feat: env open @W-9104301@ #31

merged 8 commits into from
Jun 4, 2021

Conversation

amphro
Copy link
Contributor

@amphro amphro commented May 26, 2021

What does this PR do?

Adds an env open command

What issues does this PR fix or reference?

@W-9104301@

src/commands/env/open.ts Outdated Show resolved Hide resolved
} else {
const browser = flags.browser;
this.log(`Opening ${nameOrAlias} in ${browser ? browser : 'the default browser'}.`);
await open(url, { app: { name: flags.browser } });
Copy link
Contributor

@mdonnalley mdonnalley May 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put some logic into plugin-login to use open's cross-platform browsers: https://github.com/salesforcecli/plugin-login/blob/main/src/commands/login/org.ts#L78-L84

Just an idea though - not sure it's helpful enough to put here

Copy link
Contributor

@RodEsp RodEsp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RodEsp
Copy link
Contributor

RodEsp commented Jun 3, 2021

Heya @amphro found three issues while QA'ing.

First, doesn't seem like you can open scratch orgs. I know you can't normally log into them unless you explicitly create a username/password though so not sure if this is expected or not, but either way we'd probably want the error message to be something different, not "Can't find the environment" right?
image

Second when you don't specify an env via -e you get "Opening undefined..."
image

And third, you can see this in the picture above too, you can specify any random string for a browser and it pretends that it's actually using that, when in reality nothing opens up.

@amphro
Copy link
Contributor Author

amphro commented Jun 3, 2021

I could open scratch orgs just fine @RodEsp - I fixed the other issues though. Can you give it another try?

@RodEsp
Copy link
Contributor

RodEsp commented Jun 3, 2021

Ah, seems like I just wasn't getting the right error surfaced but now I am. I created a new Scratch Org and it worked perfectly 👍🏼
image

A few new issues though, you can see them all in the image above.

  • There's no output anymore other than errors.
  • I can still enter any random string for the --browser flag and nothing happens. (Maybe related to no output?)
  • sf env open by itself (or without -e) should open the default env, this worked earlier, now it just errors.

@amphro
Copy link
Contributor Author

amphro commented Jun 3, 2021

sf env open by itself (or without -e) should open the default env, this worked earlier, now it just errors.

I changed it to an error, because we said that the defaults should be different for sf.

@RodEsp
Copy link
Contributor

RodEsp commented Jun 3, 2021

Looking way better, the only two things left seem to be

  • Entering random string for browser pretends to work.
  • Using --browser firefox also just pretends to work, worth to note I don't have firefox installed tho (--browser edge worked fine).

image

@RodEsp
Copy link
Contributor

RodEsp commented Jun 3, 2021

I'm happy to merge and open a GUS bug for the above if you want to just address it later.

@RodEsp RodEsp requested a review from mdonnalley June 3, 2021 23:08
@amphro amphro merged commit 3a79a41 into main Jun 4, 2021
@amphro amphro deleted the td/open branch June 4, 2021 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants