Skip to content

Replace backslashes in file path names. #87

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

Merged
merged 1 commit into from
May 25, 2018
Merged

Conversation

calavera
Copy link
Contributor

Fixes issues not deploying files under the right paths using Windows.

Fixes #86

Signed-off-by: David Calavera [email protected]

@calavera calavera force-pushed the fix_windows_path branch from 8907e73 to abf5aa0 Compare May 23, 2018 18:15
if err != nil {
return err
}
rel := cleanFileName(osRel)
Copy link
Member

Choose a reason for hiding this comment

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

you could use filepath.Clean https://golang.org/pkg/path/filepath/#Clean

Copy link
Contributor

@brycekahle brycekahle May 23, 2018

Choose a reason for hiding this comment

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

@rybit That will not do what we want. We want to replace filepath.Separator with / always.

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'm going to change the function name, it's misleading.

Copy link
Member

Choose a reason for hiding this comment

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

@brycekahle

Finally, any occurrences of slash are replaced by Separator.

Isn't that what we want?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, because on windows, separator = \

Copy link
Member

Choose a reason for hiding this comment

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

That means that for any windows machine, this will force / not \? If you guys say that is right then ok! You've got more context than me.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is precisely the bug we are trying to fix! netlify/netlifyctl#109

Fixes issues not deploying files under the right paths using Windows.

Signed-off-by: David Calavera <[email protected]>
@calavera calavera force-pushed the fix_windows_path branch from abf5aa0 to a524e51 Compare May 23, 2018 18:58
@calavera calavera merged commit feae114 into master May 25, 2018
@calavera calavera deleted the fix_windows_path branch May 25, 2018 16:22
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