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

Remove active workdir on prune #38

Merged
merged 2 commits into from
Jun 7, 2019
Merged

Remove active workdir on prune #38

merged 2 commits into from
Jun 7, 2019

Conversation

smacker
Copy link
Contributor

@smacker smacker commented Jun 7, 2019

Fix: #33

After prune any command will fail with

lstat $HOME/.srcd/workdirs/__active__: no such file or directory

and requires running init again. The issue is already tracked in #12.

Signed-off-by: Maxim Sukharev [email protected]

Fix: #33

After prune any command will fail with
```
lstat $HOME/.srcd/workdirs/__active__: no such file or directory
```
and requires running init again. The issue is already tracked in #12.

Signed-off-by: Maxim Sukharev <[email protected]>
@smacker smacker requested a review from a team June 7, 2019 13:31
@carlosms
Copy link
Contributor

carlosms commented Jun 7, 2019

After a prune I'm not able to run sourced workdirs, it fails with
lstat /home/cmartin/.srcd/workdirs/__active__: no such file or directory

This is correct for things like stop/status, but I should be able to see the list of workdirs in case I want to init back to one of them.

@smacker
Copy link
Contributor Author

smacker commented Jun 7, 2019

Fixed.

@smacker smacker merged commit b92b041 into src-d:master Jun 7, 2019
if err != nil {
return errors.Wrap(err, "could not read workdir directory")
}
if len(files) > 0 {
Copy link
Contributor

@dpordomingo dpordomingo Jun 10, 2019

Choose a reason for hiding this comment

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

What if there's a .DS_Store here?
Why not checking there's no RequiredFiles?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what if there is super_import_file_dont_delete_me_or_I_will_loose_1_billion_dollars?

Copy link
Contributor

Choose a reason for hiding this comment

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

if I understood properly (from prev conversation), that file should not be there, so it would be reasonable to delete it, wouldn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same as .DS_Store shouldn't be there. But it can be. Better play safe.

Copy link
Contributor

Choose a reason for hiding this comment

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

I understood that sourced will ignore user changes on workdirs, not trying to keep them when pruning, but ok 👍

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.

Prune should delete active workdir
3 participants