con / con/duct

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

Open
#186 3 comments 0 reactions 0 assignees View on GitHub
good-for-hackathon suite
Dominant language
Python
Stars
12
Forks
6
Avg merge
11d 11h
Merged PRs (30d)
1

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.