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

global registry of duct "prefixes" and a collection of con-duct suite commands to work with it #186

Open
yarikoptic opened this issue Sep 20, 2024 · 0 comments
Labels

Comments

@yarikoptic
Copy link
Member

yarikoptic commented Sep 20, 2024

somewhere under ~/.cache directory (check how platformdirs takes that cache location but we should avoid adding dependency) store a collection of prefixes with abs paths, so if I run duct somewhere with some DUCT_OUTPUT_PREFIX we would know that and add con-duct locations and -a|--all-locations to con-duct ls (#185) .

Also con-duct locations check [--prune] command would then check if locations still exist (may be folder was removed etc) and optionally prune

This would also enable to develop some simple con-duct search to find where/when a particular command was ran (and how long it took etc).

This way poor @yarikoptic would be able to find his prior analyses etc.

Implementation vise -- to avoid need for locking / avoid race conditions, idea could be simply to write simple text files named based on hash value (e.g. md5sum) of the simple json stored within such as {"cwd": cwd, "output_prefix": DUCT_OUTPUT_PREFIX} . So if file exists already -- location is known and nothing to do . If does not exist - quickly create and ignore error while conflicting -- two processes would try to create identical files.

then command would just go and load all those files. --prune would remove some which no longer found etc.

@asmacdo asmacdo added the suite label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants