life-sync

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Warnings:

Synchronize personal configs across multiple machines


[Skip to Readme]

Properties

Versions 1.0, 1.0, 1.0.1, 1.1.0.0, 1.1.1.0
Change log CHANGELOG.md
Dependencies ansi-terminal, base-noprelude (>=4.9 && <5), bytestring, containers, fmt, life-sync, microlens-platform, optparse-applicative, path, path-io, process, text (>=1.2), tomland (>=0.2.1), universum (>=1.2.0) [details]
License MIT
Copyright 2018 Kowainik
Author Kowainik
Maintainer xrom.xkov@gmail.com
Category Configuration
Home page https://github.com/kowainik/life-sync
Bug tracker https://github.com/kowainik/life-sync/issues
Source repo head: git clone https://github.com/kowainik/life-sync.git
Uploaded by shersh at 2018-06-29T14:13:05Z

Modules

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for life-sync-1.0

[back to package description]

life-sync

Hackage Build status MIT license Stackage LTS Stackage Nightly

life-sync is a CLI tool that makes it easier to synchronize dotfiles repository with personal configs across multiple machines.

Motivation

You might have some configuration files with different settings for your system. For example:

  1. Preferred settings for your editors (Spacemacs, Vim, etc.).
  2. Useful bash aliases and other miscellaneous shell settings.
  3. Git configuration.

And much more! But sometimes you start working from a new fresh machine without having your settings within touch, like in these situations:

  1. You bought a new PC or laptop.
  2. You might reinstall your system on your working machine.
  3. You were given a new laptop at work.

Every time this happens, you need to walk through the tedious process of copying your data again. It's a well-known practice to store configs in dotfiles GitHub repository. And life-sync makes it much easier to maintain this repository! With a single command, your can copy every file and directory from dotfiles repository to your machine. Or update your remote dotfiles repository after multiple local changes to different files.

Installation

Installation process can be done with one simple command:

$ cabal install life-sync

or

$ stack install life-sync-1.0

You can turn on the bash auto-completion by running the following command:

$ source <(life --bash-completion-script `which life`)

Usage

NOTE: make sure you configured SSH for your Github. life-sync assumes that you have SSH configured.

After installing life-sync you need to call command life with specified options:

$ life --help
Usage: life COMMAND
  life-sync synchronize your personal configs

Available options:
  -h,--help                Show this help text

Available commands:
  init                     Initialize GitHub repository named 'dotfiles' if you
                           don't have one.
  add                      Add file or directory to the life configuration.
  remove                   Remove file or directory from the life configuration.
  push                     Updates GitHub repository from local state and push
                           the latest version.
  pull                     Updates local state of '.life' and 'dotfiles' from
                           GitHub repository.

`life init` usage: life init OWNER
  OWNER                    Your github user name

`life add` usage: life add ((-f|--file FILE_PATH) | (-d|--dir DIRECTORY_PATH))
  -f,--file FILE_PATH      File to add
  -d,--dir FILE_PATH       Directory to add

`life remove` usage: life remove ((-f|--file FILE_PATH) | (-d|--dir DIRECTORY_PATH))
  -f,--file FILE_PATH      File to remove
  -d,--dir FILE_PATH       Directory to remote

`life push` usage: life push

`life pull` usage: life pull OWNER [-f|--no-file FILE_PATH] [-d|--no-dir FILE_PATH]
  OWNER                    Your github user name
  -f,--no-file FILE_PATH   Excluding these specific files from copying
  -d,--no-dir FILE_PATH    Excluding these specific directories from copying

NOTE: If some command takes a path to a file or a directory as an argument, the path should be specifed relative to the home directory.

life-sync keeps the structure of your dotfiles repository in its own file called .life which is stored in dotfiles repository as well.

You can see an example of dotfiles repository maintained by life-sync here:

Examples

Create dotfiles repository for the first time

$ life init MyGithubName

Track new file or directory

To track a file:

$ life add -f path/to/file/relative/from/home

To track a directory:

$ life add -d path/to/dir/relative/from/home

To stop tracking some file, use life remove command instead.

Push all changes to remote repository

$ life push

Pull all changes from remote repository

To pull every file and directory:

$ life pull ChShersh

To pull everything except some files or some directories:

$ life pull ChShersh --no-file some/file --no-dir some/dir