Skip to content

fix(launch): use forward slashes in generated .dockerignore#4883

Open
Lucais11 wants to merge 1 commit intomasterfrom
fix/dockerignore-windows-paths
Open

fix(launch): use forward slashes in generated .dockerignore#4883
Lucais11 wants to merge 1 commit intomasterfrom
fix/dockerignore-windows-paths

Conversation

@Lucais11
Copy link
Copy Markdown
Contributor

Fixes #4727

On Windows, fly launch was writing dockerignore patterns with backslashes (e.g. **\*.db) because both filepath.Rel and filepath.Join return OS-native separators. Local CLI deploys still worked, but superfly/flyctl-actions (which runs on Linux) failed with syntax error in pattern.

Normalize relDir/relFile with filepath.ToSlash after the filepath.Rel calls, and switch the four pattern joins to path.Join (which always uses /). No behavior change on Mac/Linux — filepath.ToSlash is a no-op when the OS separator is already /.

On Windows, `fly launch` was writing dockerignore patterns with backslashes (e.g. `**\*.db`) because both `filepath.Rel` and `filepath.Join` return OS-native separators. Local CLI deploys still worked, but `superfly/flyctl-actions` (which runs on Linux) failed with `syntax error in pattern`.

Normalize relDir/relFile with `filepath.ToSlash` after the `filepath.Rel` calls, and switch the four pattern joins to `path.Join` (which always uses `/`). No behavior change on Mac/Linux — `filepath.ToSlash` is a no-op when the OS separator is already `/`.

Fixes #4727
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.

fly launch generates invalid .dockerignore with backslashes on Windows

1 participant