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 init with existing file. #987

Merged
merged 1 commit into from
Sep 23, 2022
Merged

Conversation

dbrumann
Copy link
Collaborator

Fixes #977
Closes #982

@@ -30,7 +31,7 @@ public function dump(string $file): void
if ($filesystem->exists($target->getPathname())) {
throw FileAlreadyExistsException::alreadyExists($target);
}
if (!$target->isWritable()) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

FYI, a file that doesn't exist is never writable. Instead, we have to check the path (i.e. the directory containing the file), if it is writable, which is why this check never worked.

Copy link
Collaborator

@patrickkusebauch patrickkusebauch left a comment

Choose a reason for hiding this comment

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

I would suggest to make the test just a little bit more resilient. I love how you implementing the skipping of the test however, that's a neat idea.

tests/Supportive/File/DumperTest.php Outdated Show resolved Hide resolved
tests/Supportive/File/DumperTest.php Show resolved Hide resolved
@dbrumann dbrumann force-pushed the fix_init_command branch 3 times, most recently from e46d6bd to 61c7560 Compare September 22, 2022 13:40
@dbrumann dbrumann merged commit b03e6d9 into qossmic:main Sep 23, 2022
@dbrumann dbrumann deleted the fix_init_command branch September 23, 2022 07:05
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.

deptrac.yaml file examples - and init command broken
2 participants