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

Editing using swift sh edit eventually fails with "The file doesn't exist" #186

Open
itsthejb opened this issue Nov 24, 2022 · 2 comments
Open

Comments

@itsthejb
Copy link

itsthejb commented Nov 24, 2022

Hi,

Very interesting tool here, and trying to use it. However, when attempting to edit a script using swift sh edit <file>, Xcode will quickly begin complaining that the file being edited actually doesn't exist (even though it does):

Screenshot 2022-11-24 at 14 55 28

Once this happens, Xcode goes into a death spiral where there's not much you can do apart from kill it. And then it'll still re-open the project and fail to access the file...

I've seen this a few times when experimenting with scripting, and was surprised to see it also happening with this tool. It seems to be something wrong with Xcode (14.1), although has happened previously.

Since I'd love to be able to script, posting here for ideas, and to see if anyone else has experienced this.

Thanks!

@mxcl
Copy link
Owner

mxcl commented Dec 3, 2022

I believe it’s related to main.swift being a symlink. edit is a bit of a hack, and unfortunately seems to expose this bug in Xcode.

@itsthejb
Copy link
Author

itsthejb commented Dec 8, 2022

Thanks for your response.

Funnily enough, I encountered this exact same problem writing a lighter-weight tool to do a similar job; more oriented around the editing experience than anything else. I checked out this tool afterwards, and was very surprised to encounter the same problem. At least we can conclude that Xcode is to blame here...

This is very unfortunate, however - since without the Xcode native editing experience it becomes really hard to sell any script authoring tool. When I considered how to do this without a symlink, the only solution I could think up so far would be using file system watches. That certainly doesn't suit the single-script solution I was hoping to finish up...

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

No branches or pull requests

2 participants