asimov
asimov copied to clipboard
Using a file for asimov options
I think it would be a great thing to actually have a place to store options that are suggested in other issues: We could do something like: ~/.asimovrc
which contains options per line like .bashrc
or in a JSON format.
Jotting down some ideas around this, maybe something like ~/.asimov.json
:
{
// The directories that should be scanned.
"directories": [
"~/Code",
"~/Sites",
"~/Vagrant",
],
// Directories that might match but should be ignored
// https://github.com/stevegrunwell/asimov/issues/14
"ignore": [
"~/.atom/extensions",
"~/.vscode/extensions",
],
// Additional patterns that aren't already covered in Asimov core.
"additionalPatterns": {
"build.sh": ["dist"],
},
}
This would be painful to pull off with the current Bash iteration, but if we're rewriting Asimov in another language that opens the door to easily reading the JSON and merging it with default settings.
Of course, documentation around the available options here would be key 😄
I would more likely put it into ~/.config/asimov/{directories,ignore,options.json}
now. IMO, libs should stop creating files in the users root. Plus this would allow a more generic configuration thus files like ignore
and directory
are more self-explanatory and could use pattern-per-line syntax.
Read more here about the config directory:
- https://stackoverflow.com/a/1024216/4628787
- https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
I would love to have this in!
Hi everyone,
My two cents on this. Using a ~/.asimovrc file is a good idea. Could also be in a per project .asimovrc. But wait!
As developers, I do not know about you, but I do use git a lot. Could I be possible to use .gitignore file if present?
Maybe, compare it with known .gitignore patterns to remove OS specific ignore rules so the backup wont mess those.
Projects may use git but not be on a remote repository so backing them up is the way to go anyway.
Parsing .gitignore
is IMO far too much, some can have many lines and this would add so many entries in TM that I would expect it to get slower over time. And keep in mind that TM does not support Regex, so Asimov would need to parse each regex for matching patterns, which makes it slow.
Since it is macOS only, I, personally, wouldn't like a .asmimovrc
file in any of my projects.
I see the appeal of reading from the .gitignore
file, but that file has a very specific purpose that doesn't totally align with the goals of Asimov.
For a good example, consider an .env
file: this file should absolutely be present in a .gitignore
file (to prevent leaking sensitive information), but is one of the few parts of a project that would be a pain to re-create in the event of a Time Machine restore operation.
You are right. I didn't went far enough in my reflection about this.