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 "File not found" on Windows #25

Merged
merged 1 commit into from
Jul 30, 2023
Merged

Conversation

hf02
Copy link
Contributor

@hf02 hf02 commented Jun 2, 2023

This fixes #21 (again?).

As it turns out, the error was due to SwiftFormat taking the path as relative. You can see this here:

> swiftformat C:\Users\o_o\Desktop\projects\swift\test\Sources\main.swift
error: File not found at C:/Users/o_o/Desktop/projects/swift/test/Sources/C:/Users/o_o/Desktop/projects/swift/test/Sources/main.swift.

My solution was just to put a / in front of the path if on Windows. SwiftFormat takes it as absolute and it formats it fine.

Tested on Windows 11.

Copy link
Owner

@vknabel vknabel left a comment

Choose a reason for hiding this comment

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

Sorry for the late merge. Thanks a lot for your contribution!

@vknabel vknabel merged commit e12c489 into vknabel:master Jul 30, 2023
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.

SwiftFormat failed. error: File not found
2 participants