Skip to content

Latest commit

 

History

History
50 lines (42 loc) · 3.35 KB

ideas.org

File metadata and controls

50 lines (42 loc) · 3.35 KB

Main Idea

A simple script that will let you download and apply someone else’s config files with optional rollbacks. Create packages by copying required files to directory but have them come in relative to top level. ie:

currently managing the files `~/.tmux.conf` and `$XDG_CONFIG_HOME/i3/config`. When `commiting` these, simply copy them to say `$XDG_CONFIG_HOME/conapp/repo/` for a structure of:

  • repo/
    • .tmux.conf
    • .config/i3/config
  • Also have ideas for pluggable drivers(?) to allow for customization of how files are discovered/managed
    • is this needed with manual `conapp track` style commands?

Ideas

  • Both bitbucket and github support downloading public repos as tarballs
  • So have it default to github and a repo named `config`, you simply pass in username
  • When applying someone’s config take a snapshot for backup
  • need a method of specifying what files to take or not take
    • maybe a .conapprc or similar?
    • Maybe we rely entirely upon whats in the repo
  • when doing an apply, make a snapshot of all the files it would over-write. This can be grabbed by doing a `tar -tf apply.tar`

-

  • Example commands:
    • `conapp snapshot` - take a snapshot tarball of current files
    • `conapp commit` - if managing a local repo, copy (maybe not copies but hard links?) then commit said files
    • `conapp apply username` - grab `https://github.com/<username>/<repo>/tarball/master`
      • to update you just have to re-run apply username, keep the downloaded tarball as the `username + Y-m-d` in the snapshots dir to be able to apply this exact version again
      • `conapp apply username -b` same as above but grab from `https://bitbucket.org/<username>/<repo>/get/master.tar.gz`
        • Bitbucket creates a top level, pass `–strip 1` to tar to kill off top level directory
    • `conapp track filename` - copies/links file into local repo
      • This whole thing can be simplified by using a git bare checkout and having an `env` command to export an alias and other useful things.
      • Old Ideas
        • find thing -type f will handle both cases if they pass in a directory or file
        • `track info –dir` echo out path to local dir. Idea being that `pushd $(conapp track dir)` would let you move into the directory
        • `track checkout` cases:
          • make sure to check and warn about the dependancy on `git`
          • upon “checkout” reverse hardlink all the repo files onto file path.
            • This should prompt if user wants to override local files or checked out files. IE repo and local contain ~/.emacs,
              • if user says yes, then local copy of ~/.emacs gets deleted and a hardlink is made from the repo version,
              • if user says no, then repo copy of ~/.emacs gets deleted and hardlink is made in repo from local version
          • upon “checkout” of different repo, prompt if user wants to delete or keep all files managed by repo
            • Note that `git ls-files` should give us what we want here
            • after descision is made case should procede same as “clean” case
  • `conapp checkout username [–repo=]` attempt to checkout repo to have become managed tracking dir