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

Using a file for asimov options #27

Open
muuvmuuv opened this issue Oct 9, 2018 · 7 comments
Open

Using a file for asimov options #27

muuvmuuv opened this issue Oct 9, 2018 · 7 comments

Comments

@muuvmuuv
Copy link

muuvmuuv commented Oct 9, 2018

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.

@stevegrunwell
Copy link
Owner

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 😄

@stevegrunwell stevegrunwell added this to the Version 1.0.0 milestone Jun 8, 2020
@muuvmuuv
Copy link
Author

muuvmuuv commented Jun 8, 2020

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:

@pkuczynski
Copy link

I would love to have this in!

@MichelCPU
Copy link

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.

@muuvmuuv
Copy link
Author

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.

@stevegrunwell
Copy link
Owner

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.

@MichelCPU
Copy link

You are right. I didn't went far enough in my reflection about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants