Skip to content

fix: don't error when existing symlink points at correct path #1081

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

Merged
merged 1 commit into from
Jun 1, 2023

Conversation

bketelsen
Copy link
Contributor

Summary

Update error handling in wrapnix package to succeed if intended symlinks already exist

How was it tested?

Manually testing.

@bketelsen
Copy link
Contributor Author

fixes #1073

@bketelsen
Copy link
Contributor Author

confirmed this resolves the issue on macos and linux.

@savil savil requested a review from mikeland73 June 1, 2023 18:54
Copy link
Collaborator

@savil savil left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -144,6 +144,18 @@ func createSymlinksForSupportDirs(projectDir string) error {
newname := filepath.Join(projectDir, plugin.WrapperPath, dir.Name())

if err := os.Symlink(oldname, newname); err != nil {
// ignore if the symlink already exists
if errors.Is(err, os.ErrExist) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ideally, fs.ErrExist since os.ErrExist is kinda deprecated, but nbd

@savil savil merged commit be311bd into jetify-com:main Jun 1, 2023
@bketelsen bketelsen deleted the fix-symlink-err branch June 1, 2023 19:36
mikeland73 pushed a commit that referenced this pull request Jun 1, 2023
## Summary
Update error handling in wrapnix package to succeed if intended symlinks
already exist

## How was it tested?
Manually testing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants