Skip to content

Support getting spec Git info when active shell differs in syntax from bash #22454

@astone123

Description

@astone123

What would you like?

I'd like to be able to see Git info for my project even if my active shell uses a different syntax than bash. Currently I use Fish Shell as my default shell on Mac. When Cypress tries to load Git info for my project, it uses syntax that isn't supported by my active shell (Fish in this case).

The result is that my project's Git info doesn't show in the spec list

[cy:open:dev:95630]:   cypress:data-context:sources:GitDataSource command execution error: { stdout: '', stderr: "fish: Unsupported use of '='. In fish, please use 'set IFS $'\n''.", code: 0, failed: false, killed: false, signal: null, cmd: "IFS=$'\n" + `'; for file in {"/Users/adams/projects/cypress-example-kitchensink/cypress/e2e/2-advanced-examples/actions.cy.js", ... 

Screen Shot 2022-06-22 at 10 31 44 AM

Why is this needed?

This improvement would be useful for people who use different default shells and run Cypress on their machine.

Other

When we execute the command to get the Git info, we use the active shell and fall back to bash.

const result = await execa(cmd, { shell: process.env.SHELL || '/bin/bash', cwd: this.#gitBaseDir })

Forcing the use of bash fixes the issue in my case but I imagine that there are some cases where we need to use the active shell.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions