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

Do not copy/link .DS_Store files - macOS only #171

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

moltam89
Copy link

Hey guys,

This is a macOS only issue, which was driving me mad, because it seemed to happen randomly and I had to always clean my whole repo with git clean -fxd to bypass it.

It should be reproducible with any extensions, I used my UniswapX-extension for testing:

Open templates/base and templates/solidity-frameworks/hardhat with the Finder app.
Make sure (ls -a) that .DS_Store files were generated. (I still don't know when these files are generated exactly, sometimes I had to jump in and out of the folder a few times)

yarn build:dev && yarn cli -e UniswapX-extension --dev --skip fromUniswap

Screenshot 2024-12-15 at 13 34 24

Cheers,
Tamas

Copy link
Member

@rin-st rin-st left a comment

Choose a reason for hiding this comment

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

It happens for me very rarely, but I've seen those files in my create-eth/extensions too

Works great (to test I added files by hand)! Lgtm!

Copy link
Collaborator

@technophile-04 technophile-04 left a comment

Choose a reason for hiding this comment

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

Thanks @moltam89! I think encountered similar issue here scaffold-eth#436 (comment) (checkout notion doc link in that comment)

As I understand this problem occurs when we try to symlink .DS_STORE. So I was thinking maybe instead of solving the issue here in copy-template-files.ts maybe we always ignore that file in this function link util itself:

const linkRecursive = async (source: string, destination: string, options?: Options): Promise<void> => {

So next time if anyone uses copyOrLink util it by defaults handles that case and they don't have manually skip the .DS_STORE with filter.

cc @rin-st once too for his views

@moltam89
Copy link
Author

Thanks @technophile-04 !

As I understand this problem occurs when we try to symlink .DS_STORE. So I was thinking maybe instead of solving the issue here in copy-template-files.ts maybe we always ignore that file in this function link util itself:

Well, the process only fails during the link step, but I think we don't really want to copy .DS_Store files either. Maybe we should apply a filter for both copy and link?

@technophile-04
Copy link
Collaborator

Well, the process only fails during the link step, but I think we don't really want to copy .DS_Store files either. Maybe we should apply a filter for both copy and link?

Umm probably since for this PR lets don't touch copy since I think we are using direct copy function from ncp and don't have a wrapper there.

Probably in future we can tweak create-extension cli such that when u run yarn create-extension it will automatically initialize a git repo + add .gitignore at root and that .gitignore file will ignore all this misc file like .DS_Store etc.

But yeah for this PR lets not touch copy 🙌

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