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

Add feature to differentiate OS #31

Open
thomasrogerlux opened this issue Dec 22, 2017 · 1 comment
Open

Add feature to differentiate OS #31

thomasrogerlux opened this issue Dec 22, 2017 · 1 comment

Comments

@thomasrogerlux
Copy link

Hello,

Currently with the hosts option in the link task I can differentiate Linux and MacOS only if I enter specific hostname for each of my machines.

It would be a nice feature to keep the same system but to allow differentiation of the OS.

Here is an example:

"link": {
    "~/.emacs": {
        "os": {
            "Darwin": "emacs.macos",
            "Linux": "emacs.linux",
            "-": "emacs.generic"
        }
    }
}

It could be used to have different path depending on the operating system too:

"link": {
    "~/Library/Application Support/Code/User/settings.json": {
        "os": {
            "Darwin": "settings.json"
        }
    },
    "~/.config/Code/User/settings.json": {
        "os": {
            "Linux": "settings.json"
        }
    }
}
@arcticicestudio
Copy link
Owner

arcticicestudio commented Dec 28, 2017

Thanks for your contribution 👍

Sounds like a nice idea, I've also had situations where two different systems had the same hostname e.g. my main system and my Raspberry Pi, but this feature needs to be more specified before actually implementing it.

Feature Specification Notes

  • Evaluate which reliable and stable method should be used to receive the OS type. It must work for all common OS, including platforms like a Raspberry Pi (ARM).
  • Evaluate a way to safely fallback when the OS could not be detected
  • How to handle configurations where both hosts and os keys are present?
    • Handle via hierarchical order (os takes preference over hosts)?
  • Evaluate to integrate the feature into the existing hosts option e.g. optionally allow any key of hosts to provide an array instead of a string where the second index can include the OS types.

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

2 participants