-
Notifications
You must be signed in to change notification settings - Fork 192
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
[PDE-4679] fix(cli): better handling of broken symlinks while copying files to temp directory during build process #737
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zapier build
produces two files:
build/build.zip
build/source.zip
.
source.zip
already respects .gitignore
. However, I don't think build.zip
should exclude the files in .gitignore
. When running zapier build --skip-npm-install
, we intentionally don't run npm install
internally. Instead, it copies the files from the working directory's node_modules
. So even though node_modules
is in .gitignore
, we should include it in build.zip
.
I believe the problem with #706 is not about .gitignore
but is about invalid symlinks. zapier build
should show a better error message when it encounters a bad symlink. Let me know if I missed anything though!
Also, be sure to test different options:
zapier build --skip-npm-install
(currently crashing with this PR)zapier build --disable-dependency-detection
OK, this makes sense to me! I was wondering if just using |
Hmm, using Update: the issue is not |
I was thinking that, in order to address the original issue, simply alerting the user that the problem was a broken symlink might be enough and we don't need to get too creative by differentiating between file or directories... The question is then: should we skip the faulty symlink or error out of the build process? |
I think skipping with a very visible warning (like you're doing now) would be good. This looks good to me. Your comment reminds me that we need to skip the symlinks that point to a workspace. I'll go ahead and merge this, so I can fix that in my PR. Thanks! |
TO-DO: This is still missing some tests.
Intended to fix #706. Modifies the
copyDir
method by usinglstat
to avoid crashing when reading a faulty symbolic link.About
lstat
from the manual pages:Example of new warning message: