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

Mark generated files as readonly #85

Merged
merged 1 commit into from
Oct 4, 2023
Merged

Mark generated files as readonly #85

merged 1 commit into from
Oct 4, 2023

Conversation

skorulis-ap
Copy link
Collaborator

These files are marked // Do not edit directly! so setting them as readonly so Xcode will prompt to unlock the files.

I used the example app to test that the files were generated correctly. Originally I marked the file as readonly as a separate operation which prevented the next data.write from succeeding.

Copy link
Contributor

@luispadron luispadron left a comment

Choose a reason for hiding this comment

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

Sweet thank you!

let result = fileManager.createFile(
atPath: path,
contents: data,
attributes: [.posixPermissions: 0777]
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't 777 rwxrwxrwx? Do we want 555 instead for r-xr-xr-x?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Octal to decimal conversion issue. I took it from an example that is working accidentally because it's a decimal number. Changed to 0o444 since I don't need execution anyway. Thanks for catching that.

Copy link
Collaborator

@bradfol bradfol left a comment

Choose a reason for hiding this comment

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

Thank you!

@skorulis-ap skorulis-ap merged commit 263ea08 into main Oct 4, 2023
1 check passed
@skorulis-ap skorulis-ap deleted the skorulis/read-only branch October 4, 2023 21:07
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.

4 participants