Closed nkrabben closed 6 years ago
My first inclination is a strong preference for the first option since it seems rare that this is actually something you'd intend to do and it can be very confusing if moving the current directory succeeds (i.e. on POSIX systems) or when it fails (i.e. Windows).
I just added a check for this but had a question which might be good for @johnscancella to answer re:bagit-java as well — do we consider it an error to attempt to bag the current directory? (i.e. should bagit.py .
fail?)
I think bagit.py .
seems perfectly reasonable. But than again I am not the average user. The old bagit-java
CLI creates the bag and doesn't move you which is super confusing. But since this is the first mention of this I don't know how often this happens in practice.
Agreed. I want to preserve that because when Bagit 2 arrives bagit.py .
is perfectly safe since it'd only be creating a .bagit
directory without moving anything.
If a user is bagging a nested directory (bagit.py ~/Desktop/bag_level1), and their current working directory is inside that directory (e.g. cwd = ~/Desktop/bag_level1/bag_level2), bagit.py fails with the following error.
This happens because the current working directory is saved to old_dir, but then bag_level2 is moved to data/bag_level2
I have a couple of ideas on possible behavior.