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

fix: StartParameters on Windows #146

Merged

Conversation

hugodutka
Copy link
Contributor

Addresses #145.

Changes:

  • use the correct string delimiter on Windows

@hugodutka hugodutka changed the title fix: start parameters on windows fix: StartParameters on Windows Dec 6, 2024
@hugodutka hugodutka marked this pull request as ready for review December 6, 2024 17:55
@hugodutka
Copy link
Contributor Author

@fergusstrange let me know what you think.

@@ -200,9 +200,14 @@ func (ep *EmbeddedPostgres) Stop() error {

func encodeOptions(port uint32, parameters map[string]string) string {
options := []string{fmt.Sprintf("-p %d", port)}
stringDelimitingChar := "'"
// CMD on Windows uses double quotes to delimit strings. It treats single quotes as regular characters.
if runtime.GOOS == "windows" {
Copy link
Owner

Choose a reason for hiding this comment

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

Why not just move to usign " on all platforms? If you try it do tests still all pass?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I originally wanted to keep the existing behavior identical on unaffected platforms, but looks like the tests all pass when using ".

Copy link
Owner

Choose a reason for hiding this comment

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

Yeah, I reckon this is a better overall improvement though, nice job!

@fergusstrange fergusstrange merged commit f5c275b into fergusstrange:master Dec 8, 2024
8 checks passed
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.

2 participants