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

[cli] Move readme copy logic to a helper function for vc link #10084

Merged
merged 2 commits into from Jun 7, 2023

Conversation

TooTallNate
Copy link
Member

ncc has an issue with detecting + rewriting this file path for some reason. Moving to a helper function should work around that issue.

Fixing:

Error: ENOENT: no such file or directory, open '/node_modules/vercel/projects/VERCEL_DIR_README.txt'

ncc has an issue with detecting + rewriting this file path for some
reason. Moving to a helper function should work around that issue.

Fixing:

```
Error: ENOENT: no such file or directory, open '/node_modules/vercel/projects/VERCEL_DIR_README.txt'
```
@changeset-bot
Copy link

changeset-bot bot commented Jun 7, 2023

🦋 Changeset detected

Latest commit: cda8a24

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
vercel Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@TooTallNate TooTallNate added the pr: automerge Automatically merge the PR when checks pass label Jun 7, 2023
Comment on lines +289 to +292
await writeFile(
join(path, VERCEL_DIR, VERCEL_DIR_README),
await readFile(join(__dirname, 'VERCEL_DIR_README.txt'), 'utf8')
);
Copy link
Contributor

@cb1kenobi cb1kenobi Jun 7, 2023

Choose a reason for hiding this comment

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

suggestion (non-blocking): Node 14 introduce import { copyFile } from 'fs/promises';: https://nodejs.org/dist/latest-v18.x/docs/api/fs.html#fspromisescopyfilesrc-dest-mode

Suggested change
await writeFile(
join(path, VERCEL_DIR, VERCEL_DIR_README),
await readFile(join(__dirname, 'VERCEL_DIR_README.txt'), 'utf8')
);
await copyFile(
join(__dirname, 'VERCEL_DIR_README.txt'),
join(path, VERCEL_DIR, VERCEL_DIR_README)
);

Copy link
Contributor

@EndangeredMassa EndangeredMassa left a comment

Choose a reason for hiding this comment

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

I can no longer reproduce the issue with the tarball from this PR.

@kodiakhq kodiakhq bot merged commit 94d5612 into main Jun 7, 2023
103 checks passed
@kodiakhq kodiakhq bot deleted the fix/vc-link-repo-readme branch June 7, 2023 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: automerge Automatically merge the PR when checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants