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

Associate projects w/a directory so that users can make entries & export reports w/o picking a proj ID every time #4

Open
extrabad opened this issue Aug 30, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@extrabad
Copy link
Contributor

I can't believe I've done this instead of real work, but I crave formalization of this feature request I've tossed your way a few times in the past couple months.

Current behavior

To work with a given project, users must manually select it by ID. Projects are not associated with anything in particular.

Desired behavior

When my shell's working directory is in ~/code/project-foo, I invoke your utility, and no .hidden project files exist1, prompt me to name a new project, then save it to the DB and write its ID to .hidden. Do this even if I did not pass the "new project" flag.

When a .hidden file does exist and I invoke your utility, do things without requiring me to pick a proj.

With these powers combined, you could support a workflow like the following:

$ cd ~/code/my-new-proj
$ bbpm entry
No bbpm project in ~/code/my-new-proj. Enter the project's name (default my-new-proj): bread's toaster
Created new project bread's toaster.
<editor automatically opened, I write my entry>
Saved new entry #1 in bread's toaster.

$ emacs work.rs
$ bbpm entry
<editor automatically opened, I write my entry>
Saved new entry #2 in bread's toaster.

$ emacs work2.rs
$ bbpm export --format=pdf

Usecase(s)

I double-dog dare you to tell me the workflow I described is not super good.


1: Worth considering how you want this to behave when .hidden exists and doesn't contain a valid ID, or when it exists and contains a valid ID that doesn't exist in the DB. Also, .hidden is just a placeholder name; use something that won't conflict with other hidden files lying around.

@bashbunni
Copy link
Owner

os.Getwd might be what I'm looking for to get the pwd when the executable is run. Maybe I can check if dir name matches a project to start? OR I can require a hidden file in the pwd with the project name defined?

@StealthyCoder
Copy link

I would not want to litter any and all directories with .hidden files. I would think it is better to have a simple metadata file somewhere that has projects and their associated directories, and have them support globs or alternatively just does it start with the associated directory.

That to me sounds like it can support the workflow mentioned above whilst keeping everything nice and ordered and contained within the application context. Just use the XDG_CONFIG_HOME, XDG_STATE_HOME or XDG_DATA_HOME.

@bashbunni bashbunni added the enhancement New feature or request label Apr 3, 2022
@slashformotion
Copy link

That would be an amazing feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants