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

"Link" core plugin #10

Closed
arcticicestudio opened this issue Jan 7, 2017 · 0 comments
Closed

"Link" core plugin #10

arcticicestudio opened this issue Jan 7, 2017 · 0 comments

Comments

@arcticicestudio
Copy link
Owner

arcticicestudio commented Jan 7, 2017

Implement the core plugin Link(snowsaw.Plugin) in the snowsaw.plugins package to symbolically link dotfiles.

Links should specify how files and directories should be symbolically linked. If desired, items should be ablte to be specified to be forcibly linked, overwriting existing files if necessary. Environment variables in paths should be automatically expanded.

Format

Links should be specified as a dictionary mapping targets to source locations. Source locations should be specified relative to the base snowblock directory that is specified as terminal parameter. Directory names should not contain a trailing / character.

Links should support an optional extended configuration. In this type of configuration, instead of specifying source locations directly, targets should be mapped to extended configuration dictionaries.
These dictionaries should support the following options:

Option Values Default Value Required Description
create true, false false No Specifies if the parent directory should be created if necessary.
force true, false false No Specifies if the file or directory should be forcibly linked. This can cause irreversible data loss! Use with caution!
host string[] [] No Contains hostnames this link should be processed for. Links with an empty array will be processed irrespective of the host.
path string, null null No The path to map the source path. If the path is omitted or null, snowsaw will use the basename of the destination, with a leading . stripped if present.
relink true, false No false Specifies if incorrect symbolic links should be automatically overwritten.
relative true, false No false Specifies if the symbolic link should have a relative path.

Example

[
  {
    "link": {
      "~/.gitconfig": {
        "create": true,
        "host": ["archlinux-work"],
        "path": "gitconfig-work"
      },
      "~/.gitignore": {
        "force": true,
        "relink": true
      },
      "~/.git-commit-message": {
        "relative": true
      }
    }
  }
]
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

1 participant