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

[FIX] ui5Framework.Installer: Ensure target directory does not exist before rename #390

Merged
merged 2 commits into from
Jan 28, 2021

Conversation

RandomByte
Copy link
Member

Renaming a directory might fail with an EPERM error on Windows if the
target already exists. Therefore we stop creating the target directory
before the rename (this was probably the main problem) and also ensure
that it does not exist for whatever other reasons.

Related: #389
Resolves: SAP/ui5-tooling#487

…before rename

Renaming a directory might fail with an EPERM error on Windows if the
target already exists. Therefore we stop creating the target directory
before the rename (this was probably the main problem) and also ensure
that it does not exist for whatever other reasons.

Related: #389
Resolves: SAP/ui5-tooling#487
@RandomByte
Copy link
Member Author

@matz3 kindly retest in your Windows reproduction setup

@coveralls
Copy link

coveralls commented Jan 28, 2021

Coverage Status

Coverage increased (+0.03%) to 91.408% when pulling 873a0d1 on fix-install-promotion-eperm into 98bbcf5 on master.

@matz3
Copy link
Member

matz3 commented Jan 28, 2021

Validated by manually replacing the file within node_modules after a failing installation.

lib/ui5Framework/npm/Installer.js Outdated Show resolved Hide resolved
Comment on lines +82 to +85
// Check whether target dir already exists and remove it.
// A target directory already existing but missing a package.json should
// never happen. However, we want to be *really* sure that there is no target
// directory so that the rename operation won't have any no trouble.
Copy link
Member

Choose a reason for hiding this comment

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

Just as a note: This is especially important to fix the broken setup with CLI v2.9.0.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right 👍

Co-authored-by: Matthias Oßwald <1410947+matz3@users.noreply.github.com>
@RandomByte RandomByte merged commit f107cdf into master Jan 28, 2021
@RandomByte RandomByte deleted the fix-install-promotion-eperm branch January 28, 2021 11:45
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.

Failed to find SAPUI5 framework library
3 participants