Skip to content

Commit

Permalink
Release 1.11.0
Browse files Browse the repository at this point in the history
Update version number and update documentation

* Option for Cygwin to copy files instead of symlink (yadm-dev#62)
* Support `YADM_DISTRO` in Jinja templates (yadm-dev#68)
* Support pre/post hooks for every command (yadm-dev#70)
  • Loading branch information
TheLocehiliosan committed Jul 10, 2017
1 parent df1f749 commit 4b5b6c4
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 27 deletions.
5 changes: 5 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.11.0
* Option for Cygwin to copy files instead of symlink (#62)
* Support `YADM_DISTRO` in Jinja templates (#68)
* Support pre/post hooks for every command (#70)

1.10.0
* Fix `COMP_WORDS bad array subscript` bug (#64)
* Transition to semantic versioning
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ CONTRIBUTORS

Tim Byrne
Espen Henriksen
Cameron Eagans
Jan Schulz
Paraplegic Racehorse
Patrick Hof
Satoshi Ohki
Siôn Le Roux
Expand All @@ -12,3 +12,4 @@ Tomas Cernaj
Uroš Golja
Franciszek Madej
Klas Mellbourn
Paraplegic Racehorse
2 changes: 1 addition & 1 deletion yadm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ -z "$BASH_VERSION" ]; then
[ "$YADM_TEST" != 1 ] && exec bash "$0" "$@"
fi

VERSION=1.10.0
VERSION=1.11.0

YADM_WORK="$HOME"
YADM_DIR="$HOME/.yadm"
Expand Down
2 changes: 1 addition & 1 deletion yadm.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
." vim: set spell so=8:
.TH yadm 1 "10 May 2017" "1.10.0"
.TH yadm 1 "10 July 2017" "1.11.0"
.SH NAME
yadm \- Yet Another Dotfiles Manager
.SH SYNOPSIS
Expand Down
88 changes: 65 additions & 23 deletions yadm.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,19 +239,25 @@
Specify an alternate program to use instead of "git". By
default, the first "git" found in $PATH is used.

These last four "local" configurations are not stored in the
yadm.cygwin-copy
If set to "true", for Cygwin hosts, alternate files will be
copies instead of symbolic links. This might be desirable,
because non-Cygwin software may not properly interpret Cygwin
symlinks.

These last four "local" configurations are not stored in the
$HOME/.yadm/config, they are stored in the local repository.


local.class
Specify a CLASS for the purpose of symlinking alternate files.
Specify a CLASS for the purpose of symlinking alternate files.
By default, no CLASS will be matched.

local.os
Override the OS for the purpose of symlinking alternate files.

local.hostname
Override the HOSTNAME for the purpose of symlinking alternate
Override the HOSTNAME for the purpose of symlinking alternate
files.

local.user
Expand All @@ -262,7 +268,7 @@
to have an automated way of choosing an alternate version of a file for
a different operating system, host, or user. yadm implements a feature
which will automatically create a symbolic link to the appropriate ver-
sion of a file, as long as you follow a specific naming convention.
sion of a file, as long as you follow a specific naming convention.
yadm can detect files with names ending in any of the following:

##
Expand All @@ -274,10 +280,10 @@
##OS.HOSTNAME
##OS.HOSTNAME.USER

If there are any files managed by yadm's repository, or listed in
If there are any files managed by yadm's repository, or listed in
$HOME/.yadm/encrypt, which match this naming convention, symbolic links
will be created for the most appropriate version. This may best be
demonstrated by example. Assume the following files are managed by
will be created for the most appropriate version. This may best be
demonstrated by example. Assume the following files are managed by
yadm's repository:

- $HOME/path/example.txt##
Expand All @@ -299,7 +305,7 @@

$HOME/path/example.txt -> $HOME/path/example.txt##Darwin

Since the hostname doesn't match any of the managed files, the more
Since the hostname doesn't match any of the managed files, the more
generic version is chosen.

If running on a Linux server named "host4", the link will be:
Expand All @@ -317,49 +323,52 @@
If no "##" version exists and no files match the current CLASS/OS/HOST-
NAME/USER, then no link will be created.

Links are also created for directories named this way, as long as they
Links are also created for directories named this way, as long as they
have at least one yadm managed file within them.

CLASS must be manually set using yadm config local.class <class>. OS
is determined by running uname -s, HOSTNAME by running hostname, and
USER by running id -u -n. yadm will automatically create these links
CLASS must be manually set using yadm config local.class <class>. OS
is determined by running uname -s, HOSTNAME by running hostname, and
USER by running id -u -n. yadm will automatically create these links
by default. This can be disabled using the yadm.auto-alt configuration.
Even if disabled, links can be manually created by running yadm alt.

It is possible to use "%" as a "wildcard" in place of CLASS, OS, HOST-
NAME, or USER. For example, The following file could be linked for any
It is possible to use "%" as a "wildcard" in place of CLASS, OS, HOST-
NAME, or USER. For example, The following file could be linked for any
host when the user is "harvey".

$HOME/path/example.txt##%.%.harvey

CLASS is a special value which is stored locally on each host (inside
the local repository). To use alternate symlinks using CLASS, you must
set the value of class using the configuration local.class. This is
CLASS is a special value which is stored locally on each host (inside
the local repository). To use alternate symlinks using CLASS, you must
set the value of class using the configuration local.class. This is
set like any other yadm configuration with the yadm config command. The
following sets the CLASS to be "Work".

yadm config local.class Work

Similarly, the values of OS, HOSTNAME, and USER can be manually over-
ridden using the configuration options local.os, local.hostname, and
Similarly, the values of OS, HOSTNAME, and USER can be manually over-
ridden using the configuration options local.os, local.hostname, and
local.user.


## JINJA
If the envtpl command is available, Jinja templates will also be pro-
If the envtpl command is available, Jinja templates will also be pro-
cessed to create or overwrite real files. yadm will treat files ending
in

##yadm.j2

as Jinja templates. During processing, the following variables are set
as Jinja templates. During processing, the following variables are set
according to the rules explained in the ALTERNATES section:

YADM_CLASS
YADM_OS
YADM_HOSTNAME
YADM_USER

In addition YADM_DISTRO is exposed as the value of lsb_release -si if
lsb_release is locally available.

For example, a file named whatever##yadm.j2 with the following content

{% if YADM_USER == 'harvey' -%}
Expand Down Expand Up @@ -434,9 +443,42 @@
missions can be manually updated by running yadm perms. The SSH direc-
tory processing can be disabled using the yadm.ssh-perms configuration.

## HOOKS
For every command yadm supports, a program can be provided to run
before or after that command. These are referred to as "hooks". yadm
looks for hooks in the directory $HOME/.yadm/hooks. Each hook is named
using a prefix of pre_ or post_, followed by the command which should
trigger the hook. For example, to create a hook which is run after
every yadm pull command, create a hook named post_pull. Hooks must
have the executable file permission set.

If a pre_ hook is defined, and the hook terminates with a non-zero exit
status, yadm will refuse to run the yadm command. For example, if a
pre_commit hook is defined, but that command ends with a non-zero exit
status, the yadm commit will never be run. This allows one to "short-
circuit" any operation using a pre_ hook.

Hooks have the following environment variables available to them at
runtime:

YADM_HOOK_COMMAND
The command which triggered the hook

YADM_HOOK_EXIT
The exit status of the yadm command

YADM_HOOK_FULL_COMMAND
The yadm command with all command line arguments

YADM_HOOK_REPO
The path to the yadm repository

YADM_HOOK_WORK
The path to the work-tree

## FILES
The following are the default paths yadm uses for its own data. These
paths can be altered using universal options. See the OPTIONS section
The following are the default paths yadm uses for its own data. These
paths can be altered using universal options. See the OPTIONS section
for details.

$HOME/.yadm
Expand Down
5 changes: 4 additions & 1 deletion yadm.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Summary: Yet Another Dotfiles Manager
Name: yadm
Version: 1.10.0
Version: 1.11.0
Release: 1%{?dist}
URL: https://github.com/TheLocehiliosan/yadm
License: GPLv3
Expand Down Expand Up @@ -37,6 +37,9 @@ install -m 644 yadm.1 ${RPM_BUILD_ROOT}%{_mandir}/man1
%doc CHANGES CONTRIBUTORS README.md completion/yadm.bash_completion

%changelog
* Mon July 10 2017 Tim Byrne <[email protected]> - 1.11.0-1
- Bump version to 1.11.0

* Wed May 10 2017 Tim Byrne <[email protected]> - 1.10.0-1
- Bump version to 1.10.0
- Transition to semantic versioning
Expand Down

0 comments on commit 4b5b6c4

Please sign in to comment.