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

Change copy method behavior to be consistent #347

Closed
jan-vcapgemini opened this issue May 23, 2024 · 0 comments · Fixed by #359
Closed

Change copy method behavior to be consistent #347

jan-vcapgemini opened this issue May 23, 2024 · 0 comments · Fixed by #359
Assignees
Labels
bug Something isn't working core FileAccess, ProcessUtil, IdeContext, etc.

Comments

@jan-vcapgemini
Copy link
Contributor

jan-vcapgemini commented May 23, 2024

Expected behavior

Our copy method should behave like cp command on linux:

  1. cp sourceFile targetFolder / copy(sourceFile, targetFolder) should result in the sourceFile available as a copy in targetFolder/sourceFile
  2. cp -rf sourceFolder targetFolder / copy(sourceFolder, targetFolder, FileCopyMode.COPY_TREE_OVERRIDE_FILES) should result in the sourceFolder available as a copy in targetFolder/sourceFolder

Actual behavior

While 1. is working already, 2. does not behave as expected.
Instead in case of 2. the contents of sourceFolder are copied to targetFolder so it behaves like cp -rf sourceFolder/* targetFolder.
As an result e.g. when we extract a DMG file containing some *.app folder then after copying that *.app folder is missing resulting in our MacOS app workaround stopping to work.

Steps to reproduce (bug) / Use Case of feature request (enhancement)

  1. Install a tool which is using a *.dmg as an archive.
  2. Check the _ide/software/default/yourtool/yourtool/version/ folder

Comments/Hints:

We need to add a new constant to the file copy modes which will keep the root folder (getParent) inside the *.dmg file.

Affected version:

  • IDEasy: SNAPSHOT-2024.05.001
@jan-vcapgemini jan-vcapgemini added the bug Something isn't working label May 23, 2024
@jan-vcapgemini jan-vcapgemini added this to the release:2024.05.001 milestone May 23, 2024
@hohwille hohwille changed the title Fix copy method on macOS Change copy method behavior to be consistent May 23, 2024
@hohwille hohwille added the core FileAccess, ProcessUtil, IdeContext, etc. label May 23, 2024
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue May 27, 2024
added copy recursively with folder name
fixed test workarounds
removed extra resolve directory workarounds
@ndemirca ndemirca assigned jan-vcapgemini and unassigned ndemirca May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core FileAccess, ProcessUtil, IdeContext, etc.
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

3 participants