-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add clean-data recipe, rename data/ dir to tmp-db/ (#306)
The `data` directory was used for ChainStore databases generated during testing. It has been renamed to `tmp-db` to explicitly signal it's a temporary log (we are using another `tests/data` directory for python tests but this one is non-generated and permanent). A new shell script and just recipe have been added in order to delete all test-generated data. It prompts the user for confirmation with the found `tmp` and `tmp-db` directories.
- Loading branch information
Showing
12 changed files
with
45 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
# Temporary files and generated data | ||
tmp/ | ||
tmp-db/ | ||
data/ | ||
output.log | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
# Temporary files and generated data | ||
tmp/ | ||
tmp-db/ | ||
data/ | ||
output.log | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
# Find all 'tmp-db' directories in subdirectories | ||
dirs=$(find . -type d -name 'tmp-db') | ||
|
||
# Display the directories that will be deleted | ||
echo "The following 'tmp-db' directories will be deleted:" | ||
echo "$dirs" | ||
|
||
# Prompt the user for confirmation | ||
read -r -p "Are you sure you want to delete './tmp' and all 'tmp-db' directories listed above? [y/N] " ans | ||
|
||
# Check the user's response | ||
if [[ "$ans" =~ ^[Yy]$ ]]; then | ||
# User confirmed, proceed with deletion | ||
|
||
# Delete 'tmp' in the current directory (if run via justfile this is the root) | ||
rm -rf tmp | ||
|
||
# Delete all 'tmp-db' directories found | ||
find . -type d -name 'tmp-db' -exec rm -rf {} + | ||
|
||
echo "Directories deleted." | ||
else | ||
# User did not confirm, cancel the operation | ||
echo "Deletion cancelled." | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters