Compare commits

...

No commits in common. "master" and "docs/Update-about-FULL_COMMAND" have entirely different histories.

183 changed files with 1806 additions and 12716 deletions

1
.gitattributes vendored
View file

@ -1 +0,0 @@
yadm text eol=lf

View file

@ -1,77 +0,0 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at <yadm@yadm.io>. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

View file

@ -1,385 +0,0 @@
# Introduction
Thank you for considering contributing to **yadm**. I develop this project in my
limited spare time, so help is very appreciated.
All contributors must follow our [Code of Conduct][conduct]. Please make sure
you are welcoming and friendly during your interactions, and report any
unacceptable behavior to <yadm@yadm.io>.
Contributions can take many forms, and often dont require writing code—maybe
something could be documented more clearly, maybe a feature could be more
helpful, maybe installation could be easier. Help is welcome in any of these
areas.
To contribute, you can:
* Star the yadm repo, the star count helps others discover yadm.
* Report [bugs](#reporting-a-bug)
* Request [features/enhancements](#suggesting-a-feature-or-enhancement)
* Contribute changes to [code, tests](#contributing-code), and [documentation](#improving-documentation)
* Maintain installation [packages](#maintaining-packages)
* Help other users by [answering support questions](#answering-support-questions)
# Reporting a bug
Notice something amiss? Youre already helping by reporting the problem! Bugs
are tracked using GitHub issues. Here are some steps you can take to help
problems get fixed quickly and effectively:
### Before submitting an issue
Please take a quick look to see whether the problem has been reported already
(theres a list of [open issues][open-issues]). You can try the search function
with some related terms for a cursory check. If you do find a previous report,
please add a comment there instead of opening a new issue.
### Security issues
If you have found a security vulnerability, do **NOT** open an issue.
Any security issues should be emailed directly to <yadm@yadm.io>. In order to
determine whether you are dealing with a security issue, ask yourself these two
questions:
* Can I access something that's not mine, or something I shouldn't have access to?
* Can I disable something for other people?
If the answer to either of those two questions is "yes", then you're probably
dealing with a security issue.
### Submitting a (great) bug report
Choose the "[Bug report][new-bug]" issue type.
Pick a descriptive title that clearly identifies the issue.
Describe the steps that led to the problem so that we can go through the same
sequence. A clear set of steps to reproduce the problem is key to fixing an
issue. If possible, attach a [`script.gz`](#attaching-a-scriptgz) to the bug
report.
Describe what you had expected and how that differed from what happened, and
possibly, why.
Include the version numbers of your operating system, of **yadm**, and of Git.
### Attaching a script.gz
Consider trying to reproduce the bug inside a docker container using the
[yadm/testbed][] docker image. Doing so will greatly increase the likelihood of
the problem being fixed.
The easiest way to start this container, is to clone the [TheLocehiliosan/yadm
repo][yadm-repo], and use the `scripthost` make target. _(You will need `make`
and `docker` installed.)_
For example:
```text
$ git clone https://github.com/TheLocehiliosan/yadm.git
$ cd yadm
$ make scripthost version=1.12.0
Starting scripthost version="1.12.0" (recording script)
root@scripthost:~# ### run commands which
root@scripthost:~# ### demonstrate the problem
root@scripthost:~# ### a succinct set of commands is best
root@scripthost:~# exit
logout
Script saved to script.gz
$
```
A `script.gz` like this can be useful to developers to make a repeatable test
for the problem. You can attach the `script.gz` file to an issue. Look
[here][attach-help] for help with [attaching a file][attach-help].
# Suggesting a feature or enhancement
Have an idea for an improvement? Creating a feature request is a good way to
communicate it.
### Before submitting an issue
Please take a quick look to see whether your idea has been suggested already
(theres a list of [open issues][open-issues]). You can try the search function
with some related terms for a cursory check. If you do find a previous feature
request, please add a comment there instead of opening a new issue.
### Submitting a (great) feature request
Choose the "[Feature request][new-feature]" issue type.
Summarize your idea with a clear title.
Describe your suggestion in as much detail as possible.
Explain alternatives you've considered.
# Contributing code
Wow, thank you for considering making a contribution of code!
### Before you begin
Please take a quick look to see whether a similar change is already being worked
on. A similar pull request may already exist. If the change is related to an
issue, look to see if that issue has an assignee.
Consider reaching out before you start working. It's possible developers may
have some ideas and code lying around, and might be able to give you a head
start.
[Creating a hook][hooks-help] is an easy way to begin adding features to an
already existing **yadm** operation. If the hook works well, it could be the
basis of a **yadm** feature addition. Or it might just be a [useful
hook][contrib-hooks] for someone else.
### Design principles
**yadm** was created with a few core design principles in mind. Please adhere to
these principles when making changes.
* **Single repository**
* **yadm** is designed to maintain dotfiles in a single repository.
* **Very few dependencies**
* **yadm** should be as portable as possible. This is one of the main
reasons it has only two dependencies (Bash and Git). Features using other
dependencies should gracefully downgrade instead of breaking. For example,
encryption requires GnuPG installed, and displays that information if it
is not.
* **Sparse configuration**
* **yadm** should require very little configuration, and come with sensible
defaults. Changes requiring users to define meta-data for all of their
dotfiles will not be accepted.
* **Maintain dotfiles in place**
* The default treatment for tracked data should be to allow it to remain a
file, in the location it is normally kept.
* **Leverage Git**
* Stay out of the way and let Git do what its good at. Git has a deep and
rich set of features for just about every use case. Staying hands off for
almost all Git operations will make **yadm** more flexible and
future-proof.
### Repository branches and tags
* `master`
* This branch will always represent the latest release of **yadm**.
* `#.#.#` _(tags)_
* Every release of **yadm** will have a commit tagged with the version number.
* `develop`
* This branch should be used for the basis of every change. As changes are
accepted, they will be merged into `develop`.
* `release/*`
* These are ephemeral branches used to prepare new releases.
* `hotfix/*`
* These are ephemeral branches used to prepare a patch release, which only
includes bug fixes.
* `gh-pages`
* This branch contains the yadm.io website source.
* `dev-pages`
* This branch should be used for the basis of every website change. As
changes are accepted, they will be merged into dev-pages.
* `netlify/*`
* These branches deploy configurations to Netlify websites. Currently this
is only used to drive redirections for
[bootstrap.yadm.io](https://bootstrap.yadm.io/).
### GitHub workflow
1. Fork the [yadm repository][yadm-repo] on GitHub.
2. Clone your fork locally.
```text
$ git clone <url-to-your-fork>
```
3. Add the official repository (`upstream`) as a remote repository.
```text
$ git remote add upstream https://github.com/TheLocehiliosan/yadm.git
```
4. Verify you can run the test harness. _(This will require dependencies:
`make` and `docker`)_.
```text
$ make test
```
If you don't use `docker` but an OCI engine akin to `podman`, you can set it through the `OCI` switch for every target
```text
$ make test OCI=podman
```
5. Create a feature branch, based off the `develop` branch.
```text
$ git checkout -b <name-of-feature-branch> upstream/develop
```
6. Add changes to your feature branch.
7. If your changes take a few days, be sure to occasionally pull the latest
changes from upstream, to ensure that your local branch is up-to-date.
```text
$ git pull --rebase upstream develop
```
8. When your work is done, push your local branch to your fork.
```text
$ git push origin <name-of-feature-branch>
```
9. [Create a pull request][pr-help] using `develop` as the "base".
### Code conventions
When updating the yadm code, please follow these guidelines:
* Code linting
* Bash code should pass the scrutiny of [ShellCheck][shellcheck].
* Python code must pass the scrutiny of [pylint][] and [flake8][].
* Any YAML must pass the scrutiny of [yamllint][].
* Running `make test_syntax.py` is an easy way to run all linters.
* Interface changes
* Any changes to **yadm**'s interface should include a commit that updates
the `yadm.1` man page.
### Test conventions
The test system is written in Python 3 using [pytest][]. Tests should be written
for all bugs fixed and features added. To make testing portable and uniform,
tests should be performed via the [yadm/testbed][] docker image. The `Makefile`
has several "make targets" for testing. Running `make` by itself will produce a
help page.
Please follow these guidelines while writing tests:
* Organization
* Tests should be kept in the `test/` directory.
* Every test module name should start with `test_`.
* Unit tests, which test individual functions should have names that begin
with `test_unit_`.
* Completely new features should get their own test modules, while updates
to existing features should have updated test modules.
* Efficiency
* Care should be taken to make tests run as efficiently as possible.
* Scope large, unchanging, fixtures appropriately so they do not have to be
recreated multiple times.
### Commit conventions
When arranging your commits, please adhere to the following conventions.
* Commit messages
* Use the "[Tim Pope][tpope-style]" style of commit messages. Here is a
[great guide][commit-style] to writing commit messages.
* Atomic commits
* Please create only [atomic commits][atomic-commits].
* Signed commits
* All commits must be [cryptographically signed][signing-commits].
# Improving documentation
Wow, thank you for considering making documentation improvements!
There is overlap between the content of the man page, and the information on the
website. Consider reviewing both sets of documentation, and submitting similar
changes for both to improve consistency.
### Man page changes
The man page documentation is contained in the file `yadm.1`. This file is
formatted using [groff man macros][groff-man]. Changes to this file can be
tested using "make targets":
```text
$ make man
$ make man-wide
$ make man-ps
```
While the [markdown version of the man page][yadm-man] is generated from
`yadm.1`, please do not include changes to `yadm.md` within any pull request.
That file is only updated during software releases.
### Website changes
The yadm.io website is generated using [Jekyll][jekyll]. The bulk of the
documentation is created as an ordered collection within `_docs`. To make
website testing easy and portable, use the [yadm/jekyll][] docker image. The
`Makefile` has several "make targets" for testing. Running `make` by itself will
produce a help page.
* `make test`:
Perform tests done by continuous integration.
* `make up`:
Start a container to locally test the website. The test website will be
hosted at http://localhost:4000/
* `make clean`:
Remove previously built data any any Jekyll containers.
When making website changes, be sure to adhere to [code](#code-conventions) and
[commit](#commit-conventions) conventions. Use the same [GitHub
workflow](#github-workflow) when creating a pull request. However use the
`dev-pages` branch as a base instead of `develop`.
# Maintaining packages
Maintaining installation packages is very important for making **yadm**
accessible to as many people as possible. Thank you for considering contributing
in this way. Please consider the following:
* Watch releases
* GitHub allows users to "watch" a project for "releases". Doing so will
provide you with notifications when a new version of **yadm** has been
released.
* Include License
* Any package of **yadm** should include the license file from the
repository.
* Dependencies
* Be sure to include dependencies in a manner appropriate to the packaging
system being used. **yadm** won't work very well without Git. :)
# Answering support questions
Are you an experienced **yadm** user, with an advanced knowledge of Git? Your
expertise could be useful to someone else who is starting out or struggling with
a problem. Consider reviewing the list of [open support questions][questions] to
see if you can help.
[atomic-commits]: https://www.google.com/search?q=atomic+commits
[attach-help]: https://help.github.com/en/articles/file-attachments-on-issues-and-pull-requests
[commit-style]: https://chris.beams.io/posts/git-commit/#seven-rules
[conduct]: CODE_OF_CONDUCT.md
[contrib-hooks]: https://github.com/TheLocehiliosan/yadm/tree/master/contrib/hooks
[flake8]: https://pypi.org/project/flake8/
[groff-man]: https://www.gnu.org/software/groff/manual/html_node/man.html
[hooks-help]: https://github.com/TheLocehiliosan/yadm/blob/master/yadm.md#hooks
[html-proofer]: https://github.com/gjtorikian/html-proofer
[jekyll]: https://jekyllrb.com
[new-bug]: https://github.com/TheLocehiliosan/yadm/issues/new?template=BUG_REPORT.md
[new-feature]: https://github.com/TheLocehiliosan/yadm/issues/new?template=FEATURE_REQUEST.md
[open-issues]: https://github.com/TheLocehiliosan/yadm/issues
[pr-help]: https://help.github.com/en/articles/creating-a-pull-request-from-a-fork
[pylint]: https://pylint.org/
[pytest]: https://pytest.org/
[questions]: https://github.com/TheLocehiliosan/yadm/labels/question
[refactor]: https://github.com/TheLocehiliosan/yadm/issues/146
[shellcheck]: https://www.shellcheck.net
[signing-commits]: https://help.github.com/en/articles/signing-commits
[tpope-style]: https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
[yadm-man]: https://github.com/TheLocehiliosan/yadm/blob/master/yadm.md
[yadm-repo]: https://github.com/TheLocehiliosan/yadm
[yadm/jekyll]: https://hub.docker.com/r/yadm/jekyll
[yadm/testbed]: https://hub.docker.com/r/yadm/testbed
[yamllint]: https://github.com/adrienverge/yamllint

View file

@ -1,7 +0,0 @@
<!--
Before submitting, please search open and closed issues at
https://github.com/TheLocehiliosan/yadm/issues to avoid duplication.
If you have found a security vulnerability, do NOT open an issue.
Email yadm@yadm.io instead.
-->

View file

@ -1,68 +0,0 @@
---
name: Bug report
about: Create a report to help improve yadm
title: ''
labels: bug
assignees: ''
---
<!--
Before submitting, please search open and closed issues at
https://github.com/TheLocehiliosan/yadm/issues to avoid duplication.
If you have found a security vulnerability, do NOT open an issue.
Email yadm@yadm.io instead.
-->
### Describe the bug
[A clear and concise description of what the bug is.]
### To reproduce
Can this be reproduced with the yadm/testbed docker image: [Yes/No]
<!--
Consider trying to reproduce the bug inside a docker container using the
yadm/testbed docker image. https://hub.docker.com/r/yadm/testbed
The easiest way to start this container, is to clone the TheLocehiliosan/yadm
repo, and use the "scripthost" make target. For example:
$ git clone https://github.com/TheLocehiliosan/yadm.git
$ cd yadm
$ make scripthost version=1.11.0
Starting scripthost version="1.11.0" (recording script)
root@scripthost:~# ### run commands which
root@scripthost:~# ### demonstrate the problem
root@scripthost:~# ### a succinct set of commands is best
root@scripthost:~# exit
logout
Script saved to script.gz
$
A script like this can be useful to developers to make a repeatable test for the
problem. You can attach a script.gz file to an issue.
https://help.github.com/en/articles/file-attachments-on-issues-and-pull-requests
-->
Steps to reproduce the behavior:
1. Run command '....'
2. Run command '....'
3. Run command '....'
4. See error
### Expected behavior
[A clear and concise description of what you expected to happen.]
### Environment
- Operating system: [Ubuntu 18.04, yadm/testbed, etc.]
- Version yadm: [found via `yadm version`]
- Version Git: [found via `git --version`]
### Additional context
[Add any other context about the problem here.]

View file

@ -1,29 +0,0 @@
---
name: Feature request
about: Suggest an idea for yadm
title: ''
labels: feature
assignees: ''
---
<!--
Before submitting, please search open and closed issues at
https://github.com/TheLocehiliosan/yadm/issues to avoid duplication.
-->
### Is your feature request related to a problem? Please describe.
[A clear and concise description of what the problem is. Ex. I'm always frustrated when ...]
### Describe the solution you'd like
[A clear and concise description of what you want to happen.]
### Describe alternatives you've considered
[A clear and concise description of any alternative solutions or features you've
considered. For example, have you considered using yadm "hooks" as a solution?]
### Additional context
[Add any other context or screenshots about the feature request here.]

View file

@ -1,23 +0,0 @@
---
name: Other issue
about: Report issues with documentation, packaging, or something else
title: ''
labels: ''
assignees: ''
---
<!--
Before submitting, please search open and closed issues at
https://github.com/TheLocehiliosan/yadm/issues to avoid duplication.
-->
### This issue is about
* [ ] Man pages or command-line usage
* [ ] Website documentation
* [ ] Packaging
* [ ] Other
### Describe the issue
[A clear and concise description of the issue.]

View file

@ -1,36 +0,0 @@
---
name: Support
about: Get help using yadm
title: ''
labels: 'question'
assignees: ''
---
<!--
Before submitting, please search open and closed issues at
https://github.com/TheLocehiliosan/yadm/issues to avoid duplication.
Please also consult:
* The FAQ: https://yadm.io/docs/faq
* The manual: https://github.com/TheLocehiliosan/yadm/blob/master/yadm.md
-->
### This question is about
* [ ] Installation
* [ ] Initializing / Cloning
* [ ] Alternate files
* [ ] Jinja templates
* [ ] Encryption
* [ ] Bootstrap
* [ ] Hooks
* [ ] Other
### Describe your question
<!--
Consider including:
* the commands you've run, and the output produced
* links to any public repo/branch involved
-->
[A clear and concise description of the question.]

View file

@ -1,34 +0,0 @@
### What does this PR do?
[A clear and concise description of what this pull request accomplishes.]
### What issues does this PR fix or reference?
<!--
Be sure to preface the issue/PR numbers with a "#".
-->
[A list of related issues / pull requests.]
### Previous Behavior
[Describe the existing behavior.]
### New Behavior
[Describe the behavior, after this PR is applied.]
### Have [tests][1] been written for this change?
[Yes / No]
### Have these commits been [signed with GnuPG][2]?
[Yes / No]
---
Please review [yadm's Contributing Guide][3] for best practices.
[1]: https://github.com/TheLocehiliosan/yadm/blob/master/.github/CONTRIBUTING.md#test-conventions
[2]: https://help.github.com/en/articles/signing-commits
[3]: https://github.com/TheLocehiliosan/yadm/blob/master/.github/CONTRIBUTING.md

View file

@ -1,20 +0,0 @@
---
name: Scheduled Site Tests
on: # yamllint disable-line rule:truthy
schedule:
- cron: "0 0 1 * *" # Monthly
jobs:
Tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: gh-pages
- run: >-
docker create -t
--name yadm-website
--entrypoint test/validate
yadm/jekyll:2019-10-17;
docker cp ./ yadm-website:/srv/jekyll
- name: Test Site
run: docker start yadm-website -a

View file

@ -1,25 +0,0 @@
---
name: Close Stale Issues
on: # yamllint disable-line rule:truthy
schedule:
- cron: "30 1 * * *" # Daily
jobs:
Stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v4
with:
close-issue-message: >-
This issue was closed because it has been labeled as stale for 7
days with no activity.
days-before-close: 7
days-before-stale: 60
exempt-all-assignees: true
exempt-issue-labels: in develop, 1, 2, 3
exempt-pr-labels: in develop, 1, 2, 3
stale-issue-label: stale
stale-issue-message: >-
This issue has been labeled as stale because it has been open 60
days with no activity. Remove stale label or comment or this will
be closed in 7 days.
stale-pr-label: stale

View file

@ -1,13 +0,0 @@
---
name: Tests
on: # yamllint disable-line rule:truthy
- push
- pull_request
- workflow_dispatch
jobs:
Tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Tests
run: make test

5
.gitignore vendored
View file

@ -1,7 +1,4 @@
.DS_Store
.jekyll-metadata
.pytest_cache
.sass-cache
.testyadm
Gemfile.lock
_site
testenv

16
.travis.yml Normal file
View file

@ -0,0 +1,16 @@
---
env:
- IMAGE="yadm/jekyll:2019-10-17"
language: minimal
services:
- docker
before_install:
- docker pull $IMAGE
- docker create -t --name yadm-website --entrypoint test/validate $IMAGE
- docker cp ./ yadm-website:/srv/jekyll
script:
- docker start yadm-website -a
branches: # necessary to force builds of gh-pages:
only:
- gh-pages
- "/.*/"

193
CHANGES
View file

@ -1,193 +0,0 @@
3.2.2
* Support spaces in distro/distro-family (#432)
* Fix zsh hanging when tab completing add/checkout (#417)
* Add yadm-untracked script to contributed files (#418)
* Fix documentation typos (#425)
* Support docker-like OCI engines for dev testing (#431)
3.2.1
* Fix Bash 3 bad array subscript bug (#411)
3.2.0
* Support architecture for alternates/templates (#202, #203, #393)
* Support distro_family for alternates/templates (#213)
* Support setting multiple classes (#185, #304)
* Support environment variables in default template processor (#347)
* Update version command to include Bash & Git versions (#377)
3.1.1
* Fix clone support for older versions of Git (#348)
* Fix support for multiple GPG recipients (#342)
* Find symlinks in bootstrap-in-dir (#340)
3.1.0
* Use `git clone` directly during clone (#289, #323)
* Fix compatibility bug with Git completions (#318, #321)
* Support relative paths for --yadm-* and -w (#301)
* Improve parsing of if-statement in default template (#303)
* Read files without running cat in subshells (#317)
* Improve portability of updating read-only files (#320)
* Various code improvements (#306, #307, #311)
3.0.2
* Fix parsing by sh (#299)
3.0.1
* Improve handling of submodules at upgrade (#284, #285, #293)
* Improve Zsh completions (#292, #298)
* Use stderr for error messages (#297)
3.0.0
* Support encryption with OpenSSL (#138)
* Support "include" directive in built-in template processor (#255)
* Support extensions for alternate files and templates (#257)
* Improve support for default branches (#231, #232)
* Add --version and --help as yadm internal commands (#267)
* Improve support for XDG base directory specification
* Use XDG_DATA_HOME used for encrypted data and repository (#208)
* Default repo is now ~/.local/share/yadm/repo.git
* Default encrypted archive is now ~/.local/share/yadm/archive
* Improve shell completions (#238, #274, #275)
* Remove support for YADM_COMPATIBILITY=1 (#242)
* Remove deprecated option cygwin-copy
* Fix template mode inheritance on FreeBSD (#243, #246)
* Fix hook execution under MinGW (#150)
* Improve compatibility with Oil shell (#210)
2.5.0
* Support for transcrypt (#197)
* Support ESH templates (#220)
* Preserve file mode of template (#193)
* Fish shell completions (#224)
* Fix alt processing when worktree is `/` (#198)
* Assert config directory if missing (#226, #227)
* Documentation improvements (#229)
2.4.0
* Support multiple keys in `yadm.gpg-recipient` (#139)
* Ensure all templates are written atomically (#142)
* Add encrypt_with_checksums to the hooks collection (#188)
* Escape white space in YADM_HOOK_FULL_COMMAND (#187)
* Improve parsing of os-release (#194)
* Improve identification of WSL (#196)
* Fix troff warnings emitted by man page (#195)
* Write encrypt-based exclusions during decrypt
2.3.0
* Support git-crypt (#168)
* Support specifying a command after `yadm enter`
* Expose GIT_WORK_TREE during `yadm enter` (#160)
* Support GNUPGHOME environment variable (#134)
* Assert private dirs, only when worktree = $HOME (#171)
2.2.0
* Resolve hostname using `uname -n` (#182)
* Use /etc/os-release if lsb_release is missing (#175)
* Issue warning for any invalid alternates found (#183)
* Add support for gawk (#180)
2.1.0
* Use relative symlinks for alternates (#100, #177)
* Support double-star globs in .config/yadm/encrypt (#109)
* Improve bash completion (#136)
* Update docs about using magit (#123)
* Note exception for WSL (#113)
2.0.1
* Fix bug with worktree permissions (#174)
2.0.0
* Support XDG base directory specification
* Redesign alternate processing
* Add built-in default template processor
* Allow storing alternates in yadm dir (#90)
* Add support for j2cli template processor
* Ignore encrypted files (#69)
* Support DISTRO in alternates (#72)
* Support `source` in templates (#163)
* Change yadm.cygwin-copy to yadm.alt-copy
* Support `-b <branch>` when cloning (#133)
* Support includes for j2-based templates (#114)
* Remove stale/invalid linked alternates (#65)
* Add support for Mingw/Msys (#102)
* Allow `-l` to pass thru to the `yadm config` command
* Improve processing of `yadm/encrypt`
* Fix bugs in legacy alternate processing
* Fix bug with hidden private files
* Improve support for older versions of Git
* Add upgrade command
1.12.0
* Add basic Zsh completion (#71, #79)
* Support directories in `.yadm/encrypt` (#81, #82)
* Support exclusions in `.yadm/encrypt` (#86)
* Improve portability with printf (#87)
* Eliminate usage of `eval` and `ls`
1.11.1
* Create private dirs prior to merge (#74)
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
1.09
* Add Bash completion script (#60)
* Support WSL detection (#61)
* Add introspect command (used by completion)
1.08
* Fix bug alternates based on `CLASS` (#51)
* Support globs and paths with space in .yadm/encrypt (#53, #54)
* Add support for alternate files using Jinja templates (#56, #58)
* Add `enter` command, for creating a sub-shell (#57)
* Support local.hostname properly (#59)
1.07
* Add `CLASS` to supported alt-link patterns (#21)
* Add bootstrap command (#42)
* Support wildcards for alt-links (#43)
* Stash conflicting data during clone (#44)
* Offer bootstrap after successful clone (#45)
* Display supported configs for `yadm config` (#46)
* Add "curl-pipe" program to clone without installation (#48)
* Fix bug in alt-link regular expressions (#49)
1.06
* Improve portability of `hostname` (#23)
* Fix incompatibilities between Cygwin and Git for Windows (#26)
* Allow Git program to be configured via yadm.git-program (#30)
* Support alt-links for encrypted files (#34)
* Exit with the same return value as Git (#35)
* Support spaces in alt-link paths (#36)
* Ignore empty lines in .yadm/encrypt (#40)
* Fix typos (#41)
1.05
* Improve portability of shebang line (#14)
* Support for symlinked directories (#17)
* Improve portability of tar parameters (#18)
* Support alternate gpg program (#19)
* Fallback to using `ls` if `/bin/ls` does not exist (#22)
1.04
* Support alternate paths for yadm data (#4, #5)
* Support asymmetric encryption (#7, #8)
* Prevent the mixing of output and gpg prompts
1.03
* Add username matching for alternate files (#1)
1.02
* Handle permissions for `~/.gnupg/*gpg`
1.01
* Set `status.showUntrackedFiles` to "no"
1.00
* Initial public release

1
CNAME Normal file
View file

@ -0,0 +1 @@
yadm.io

View file

@ -1,52 +0,0 @@
CONTRIBUTORS
Tim Byrne
Erik Flodin
Martin Zuther
Jan Schulz
Ross Smith II
Jonathan Daigle
Luis López
Tin Lai
Espen Henriksen
Cameron Eagans
Klas Mellbourn
James Clark
Glenn Waters
Nicolas signed-log FORMICHELLA
Tomas Cernaj
Joshua Cold
jonasc
Nicolas stig124 FORMICHELLA
Chad Wade Day, Jr
Sébastien Gross
David Mandelberg
Paulo Köch
Oren Zipori
Daniel Gray
Paraplegic Racehorse
japm48
Siôn Le Roux
Mateusz Piotrowski
Uroš Golja
Satoshi Ohki
Jonas
Franciszek Madej
Daniel Wagenknecht
Stig Palmquist
Patrick Hof
con-f-use
Samisafool
Bram Ceulemans
Travis A. Everett
Sheng Yang
Jared Smartt
Adam Jimerson
dessert1
addshore
Tim Condit
Thomas Luzat
Russ Allbery
Brayden Banks
Alexandre GV
Felipe S. S. Schneider

13
Dockerfile Normal file
View file

@ -0,0 +1,13 @@
FROM jekyll/jekyll:4.0.0
MAINTAINER Tim Byrne <sultan@locehilios.com>
# Convenience settings for the testbed's root account
RUN echo 'set -o vi' >> /root/.bashrc
# Create a flag to identify when running inside the yadm/jekyll image
RUN touch /.yadmjekyll
# Extra dependencies for testing
RUN gem install html-proofer
RUN apk add --update py-pip
RUN pip install yamllint==1.15.0

11
Gemfile Normal file
View file

@ -0,0 +1,11 @@
source "https://rubygems.org"
# ensure older verion of faraday
gem 'faraday', '~> 0.17.3'
gem "github-pages", group: :jekyll_plugins
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.6"
gem "jekyll-include-cache"
end

674
LICENSE
View file

@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

252
Makefile
View file

@ -1,6 +1,5 @@
PYTESTS = $(wildcard test/test_*.py)
IMAGE = docker.io/yadm/testbed:2022-01-07
OCI = docker
IGNORED = .jekyll-metadata Gemfile.lock _site
VOLUME_ARG =
.PHONY: all
all:
@ -10,206 +9,83 @@ all:
.PHONY: usage
usage:
@echo
@echo 'make TARGET [option=value, ...]'
@echo 'make TARGET'
@echo
@echo 'TESTING'
@echo
@echo ' make test [testargs=ARGS]'
@echo ' - Run all tests. "testargs" can specify a single string of arguments'
@echo ' for py.test.'
@echo ' make test'
@echo ' - Perform tests done by continuous integration.'
@echo ' This target will:'
@echo ' - Remove previously built data'
@echo ' - Build the site'
@echo ' - Test the site using html-proofer'
@echo
@echo ' make <testfile>.py [testargs=ARGS]'
@echo ' - Run tests from a specific test file. "testargs" can specify a'
@echo ' single string of arguments for py.test.'
@echo ' make up'
@echo ' - Start a container to locally test the website.'
@echo ' This target will:'
@echo ' - Start a jekyll container (re-using it if it already exists)'
@echo ' - Expose the website on port 4000 of the local host'
@echo
@echo ' make testhost [version=VERSION]'
@echo ' - Create an ephemeral container for doing adhoc yadm testing. The'
@echo ' working copy version of yadm will be used unless "version" is'
@echo ' specified. "version" can be set to any commit, branch, tag, etc.'
@echo ' The targeted "version" will be retrieved from the repo, and'
@echo ' linked into the container as a local volume.'
@echo ' make logs'
@echo ' - Tail the logs of the running jekyll container.'
@echo
@echo ' make scripthost [version=VERSION]'
@echo ' - Create an ephemeral container for demonstrating a bug. After'
@echo ' exiting the shell, a log of the commands used to illustrate the'
@echo ' problem will be written to the file "script.txt". This file can'
@echo ' be useful to developers to make a repeatable test for the'
@echo ' problem. The version parameter works as for "testhost" above.'
@echo ' make restart'
@echo ' - Restart the jekyll container.'
@echo
@echo 'LINTING'
@echo ' make down'
@echo ' - Shutdown and remove the jekyll container.'
@echo
@echo ' make testenv'
@echo ' - Create a python virtual environment with the same dependencies'
@echo " used by yadm's testbed environment. Creating and activating"
@echo ' this environment might be useful if your editor does real time'
@echo ' linting of python files. After creating the virtual environment,'
@echo ' you can activate it by typing:'
@echo ' make clean'
@echo ' - Remove previously built data and any jekyll containers.'
@echo
@echo ' source testenv/bin/activate'
@echo
@echo 'MANPAGES'
@echo
@echo ' make man'
@echo ' - View yadm.1 as a standard man page.'
@echo
@echo ' make man-wide'
@echo ' - View yadm.1 as a man page, using all columns of your display.'
@echo
@echo ' make man-ps'
@echo ' - Create a postscript version of the man page.'
@echo
@echo 'FILE GENERATION'
@echo
@echo ' make yadm.md'
@echo ' - Generate the markdown version of the man page (for viewing on'
@echo ' the web).'
@echo
@echo ' make contrib'
@echo ' - Generate the CONTRIBUTORS file, from the repo history.'
@echo
@echo 'INSTALLATION'
@echo
@echo ' make install PREFIX=<prefix>'
@echo ' - Install yadm, manpage, etc. to <prefix>'
@echo
@echo 'UTILITIES'
@echo
@echo ' make sync-clock'
@echo ' - Reset the hardware clock for the docker hypervisor host. This'
@echo ' can be useful for docker engine hosts which are not'
@echo ' Linux-based.'
@echo ' make fresh'
@echo ' - Like "make clean", but also removes the docker volumes.'
@echo
# Make it possible to run make specifying a py.test test file
.PHONY: $(PYTESTS)
$(PYTESTS):
@$(MAKE) test testargs="$@ $(testargs)"
%.py:
@$(MAKE) test testargs="-k $@ $(testargs)"
# Run all tests with additional testargs
.PHONY: test
test:
@if [ -f /.yadmtestbed ]; then \
cd /yadm && \
py.test -v $(testargs); \
else \
$(MAKE) -s require-docker && \
$(OCI) run \
--rm -t$(shell test -t 0 && echo i) \
-v "$(CURDIR):/yadm:ro" \
$(IMAGE) \
make test testargs="$(testargs)"; \
test: require-docker-compose clean
docker-compose run --rm website test/validate
.PHONY: up
up: require-docker-compose
docker-compose up --no-recreate -d
@echo
@echo Started docker container. It will probably take a bit of time before
@echo the webserver is listening. You can run \"make logs\" to watch the logs
@echo of this container.
@echo
@echo The site will be served at http://0.0.0.0:4000/
.PHONY: logs
logs: require-docker-compose
docker-compose logs --tail 0 -f
.PHONY: restart
restart: require-docker-compose
docker-compose restart
.PHONY: down
down: require-docker-compose
docker-compose down --remove-orphans ${VOLUME_ARG}
.PHONY: clean
clean: down
rm -rf ${IGNORED}
.PHONY: fresh
fresh: VOLUME_ARG = -v
fresh: clean
.PHONY: require-docker-compose
require-docker-compose: require-docker
@if ! command -v "docker-compose" >/dev/null 2>&1; then \
echo "Sorry, this make target requires docker-compose to be installed."; \
false; \
fi
.PHONY: .testyadm
.testyadm: version ?= local
.testyadm:
@rm -f $@
@if [ "$(version)" = "local" ]; then \
ln -sf yadm $@; \
echo "Using local yadm ($$(git describe --tags --dirty))"; \
else \
git show $(version):yadm > $@; \
echo "Using yadm version $$(git describe --tags $(version))"; \
fi
@chmod a+x $@
.PHONY: testhost
testhost: require-docker .testyadm
@echo "Starting testhost"
@$(OCI) run \
-w /root \
--hostname testhost \
--rm -it \
-v "$(CURDIR)/.testyadm:/bin/yadm:ro" \
$(IMAGE) \
bash -l
.PHONY: scripthost
scripthost: require-docker .testyadm
@echo "Starting scripthost \(recording script\)"
@printf '' > script.gz
@$(OCI) run \
-w /root \
--hostname scripthost \
--rm -it \
-v "$(CURDIR)/script.gz:/script.gz:rw" \
-v "$(CURDIR)/.testyadm:/bin/yadm:ro" \
$(IMAGE) \
bash -c "script /tmp/script -q -c 'bash -l'; gzip < /tmp/script > /script.gz"
@echo
@echo "Script saved to $(CURDIR)/script.gz"
.PHONY: testenv
testenv:
@echo 'Creating a local virtual environment in "testenv/"'
@echo
@rm -rf testenv
python3 -m venv --clear testenv
testenv/bin/pip3 install --upgrade pip setuptools
testenv/bin/pip3 install --upgrade -r test/requirements.txt;
@for v in $$(sed -En -e 's:.*/yadm-([0-9.]+)$$:\1:p' test/Dockerfile); do \
git show $$v:yadm > testenv/bin/yadm-$$v; \
chmod +x testenv/bin/yadm-$$v; \
done
@echo
@echo 'To activate this test environment type:'
@echo ' source testenv/bin/activate'
.PHONY: image
image:
@$(OCI) build -f test/Dockerfile . -t "$(IMAGE)"
.PHONY: man
man:
@groff -man -Tascii ./yadm.1 | less
.PHONY: man-wide
man-wide:
@man ./yadm.1
.PHONY: man-ps
man-ps:
@groff -man -Tps ./yadm.1 > yadm.ps
yadm.md: yadm.1
@groff -man -Tutf8 -Z ./yadm.1 | grotty -c | col -bx | sed 's/^[A-Z]/## &/g' | sed '/yadm(1)/d' > yadm.md
.PHONY: contrib
contrib: SHELL = /bin/bash
contrib:
@echo -e "CONTRIBUTORS\n" > CONTRIBUTORS
@IFS=$$'\n'; for author in $$(git shortlog -ns master gh-pages develop dev-pages | cut -f2); do \
git log master gh-pages develop dev-pages \
--author="$$author" --format=tformat: --numstat | \
awk "{sum += \$$1 + \$$2} END {print sum \"\t\" \"$$author\"}"; \
done | sort -nr | cut -f2 >> CONTRIBUTORS
.PHONY: install
install:
@[ -n "$(PREFIX)" ] || { echo "PREFIX is not set"; exit 1; }
@{\
set -e ;\
bin="$(DESTDIR)$(PREFIX)/bin" ;\
doc="$(DESTDIR)$(PREFIX)/share/doc/yadm" ;\
man="$(DESTDIR)$(PREFIX)/share/man/man1" ;\
install -d "$$bin" "$$doc" "$$man" ;\
install -m 0755 yadm "$$bin" ;\
install -m 0644 yadm.1 "$$man" ;\
install -m 0644 CHANGES CONTRIBUTORS LICENSE "$$doc" ;\
cp -r contrib "$$doc" ;\
}
.PHONY: sync-clock
sync-clock:
$(OCI) run --rm --privileged alpine hwclock -s
.PHONY: require-docker
require-docker:
@if ! command -v $(OCI) > /dev/null 2>&1; then \
echo "Sorry, this make target requires docker to be installed, to use another docker-compatible engine, like podman, re-run the make command adding OCI=podman"; \
@if ! command -v "docker" >/dev/null 2>&1; then \
echo "Sorry, this make target requires docker to be installed."; \
false; \
fi

View file

@ -1,87 +0,0 @@
# yadm - Yet Another Dotfiles Manager
[![Latest Version][releases-badge]][releases-link]
[![Homebrew Version][homebrew-badge]][homebrew-link]
[![OBS Version][obs-badge]][obs-link]
[![Arch Version][arch-badge]][arch-link]
[![License][license-badge]][license-link]<br />
[![Master Update][master-date]][master-commits]
[![Develop Update][develop-date]][develop-commits]
[![Website Update][website-date]][website-commits]<br />
[![Master Status][master-badge]][workflow-master]
[![Develop Status][develop-badge]][workflow-develop]
[![GH Pages Status][gh-pages-badge]][workflow-gh-pages]
[![Dev Pages Status][dev-pages-badge]][workflow-dev-pages]
[https://yadm.io/][website-link]
**yadm** is a tool for managing [dotfiles][].
* Based on [Git][], with full range of Git's features
* Supports system-specific alternative files or templated files
* Encryption of private data using [GnuPG][], [OpenSSL][], [transcrypt][], or
[git-crypt][]
* Customizable initialization (bootstrapping)
* Customizable hooks for before and after any operation
Complete features, usage, examples and installation instructions can be found on
the [yadm.io][website-link] website.
## A very quick tour
# Initialize a new repository
yadm init
# Clone an existing repository
yadm clone <url>
# Add files/changes
yadm add <important file>
yadm commit
# Encrypt your ssh key
echo '.ssh/id_rsa' > ~/.config/yadm/encrypt
yadm encrypt
# Later, decrypt your ssh key
yadm decrypt
# Create different files for Linux vs MacOS
yadm add path/file.cfg##os.Linux
yadm add path/file.cfg##os.Darwin
If you enjoy using yadm, consider adding a star to the repository on GitHub.
The star count helps others discover yadm.
[Git]: https://git-scm.com/
[GnuPG]: https://gnupg.org/
[OpenSSL]: https://www.openssl.org/
[arch-badge]: https://img.shields.io/archlinux/v/extra/any/yadm
[arch-link]: https://archlinux.org/packages/extra/any/yadm/
[dev-pages-badge]: https://img.shields.io/github/actions/workflow/status/TheLocehiliosan/yadm/test.yml?branch=dev-pages
[develop-badge]: https://img.shields.io/github/actions/workflow/status/TheLocehiliosan/yadm/test.yml?branch=develop
[develop-commits]: https://github.com/TheLocehiliosan/yadm/commits/develop
[develop-date]: https://img.shields.io/github/last-commit/TheLocehiliosan/yadm/develop.svg?label=develop
[dotfiles]: https://en.wikipedia.org/wiki/Hidden_file_and_hidden_directory
[gh-pages-badge]: https://img.shields.io/github/actions/workflow/status/TheLocehiliosan/yadm/test.yml?branch=gh-pages
[git-crypt]: https://github.com/AGWA/git-crypt
[homebrew-badge]: https://img.shields.io/homebrew/v/yadm.svg
[homebrew-link]: https://formulae.brew.sh/formula/yadm
[license-badge]: https://img.shields.io/github/license/TheLocehiliosan/yadm.svg
[license-link]: https://github.com/TheLocehiliosan/yadm/blob/master/LICENSE
[master-badge]: https://img.shields.io/github/actions/workflow/status/TheLocehiliosan/yadm/test.yml?branch=master
[master-commits]: https://github.com/TheLocehiliosan/yadm/commits/master
[master-date]: https://img.shields.io/github/last-commit/TheLocehiliosan/yadm/master.svg?label=master
[obs-badge]: https://img.shields.io/badge/OBS-v3.2.2-blue
[obs-link]: https://software.opensuse.org//download.html?project=home%3ATheLocehiliosan%3Ayadm&package=yadm
[releases-badge]: https://img.shields.io/github/tag/TheLocehiliosan/yadm.svg?label=latest+release
[releases-link]: https://github.com/TheLocehiliosan/yadm/releases
[transcrypt]: https://github.com/elasticdog/transcrypt
[travis-ci]: https://travis-ci.com/TheLocehiliosan/yadm/branches
[website-commits]: https://github.com/TheLocehiliosan/yadm/commits/gh-pages
[website-date]: https://img.shields.io/github/last-commit/TheLocehiliosan/yadm/gh-pages.svg?label=website
[website-link]: https://yadm.io/
[workflow-dev-pages]: https://github.com/thelocehiliosan/yadm/actions?query=workflow%3a%22test+site%22+branch%3adev-pages
[workflow-develop]: https://github.com/TheLocehiliosan/yadm/actions?query=workflow%3ATests+branch%3Adevelop
[workflow-gh-pages]: https://github.com/thelocehiliosan/yadm/actions?query=workflow%3a%22test+site%22+branch%3agh-pages
[workflow-master]: https://github.com/TheLocehiliosan/yadm/actions?query=workflow%3ATests+branch%3Amaster

171
_config.yml Normal file
View file

@ -0,0 +1,171 @@
---
# Theme
remote_theme: mmistakes/minimal-mistakes@4.15.2
minimal_mistakes_skin: default
# Site Settings
locale: en-US
title: yadm
title_separator: "-"
name: Tim Byrne
description: Yet Another Dotfiles Manager
url: https://yadm.io
repository: TheLocehiliosan/yadm
# Social Sharing
twitter:
username: TheLocehiliosan
footer:
links:
- label: "GitHub"
icon: "fab fa-fw fa-github"
url: https://github.com/TheLocehiliosan
- label: "Twitter"
icon: "fab fa-fw fa-twitter-square"
url: https://twitter.com/TheLocehiliosan
- label: "Privacy Policy"
icon: "fas fa-fw fa-user-shield"
url: /privacy
atom_feed: false
# path: false
# Analytics
analytics:
provider: google-universal
google:
tracking_id: UA-83783540-1
gtm: GTM-55MC869
# Site Author
author:
name: Tim Byrne
email: sultan@locehilios.com
links:
- label: Email
icon: fas fa-fw fa-envelope-square
url: mailto:sultan@locehilios.com
- label: Twitter
icon: fab fa-fw fa-twitter-square
url: https://twitter.com/TheLocehiliosan
- label: GitHub
icon: fab fa-fw fa-github
url: https://github.com/TheLocehiliosan
# Reading Files
include:
- _docs
- _pages
exclude:
- CNAME
- Gemfile*
- Makefile
- docker-compose.yml
- test*
keep_files:
- .git
encoding: utf-8
markdown_ext: markdown,mkdown,mkdn,mkd,md
# Conversion
markdown: kramdown
highlighter: rouge
lsi: false
excerpt_separator: "\n\n"
incremental: false
# Markdown Processing
kramdown:
input: GFM
hard_wrap: false
auto_ids: true
footnote_nr: 1
entity_output: as_char
toc_levels: 1..2
smart_quotes: lsquo,rsquo,ldquo,rdquo
enable_coderay: false
# Collections
collections:
docs:
output: true
permalink: /:collection/:path/
# Sass/SCSS
sass:
sass_dir: _sass
style: compressed
# Outputting
permalink: /:categories/:title/
# paginate: 5
# paginate_path: /page:num/
# Plugins (previously gems:)
plugins:
- jekyll-paginate
- jekyll-sitemap
- jekyll-gist
- jekyll-feed
- jemoji
- jekyll-include-cache
# mimic GitHub Pages with --safe
whitelist:
- jekyll-paginate
- jekyll-sitemap
- jekyll-gist
- jekyll-feed
- jemoji
- jekyll-include-cache
# Archives
# Type
# - GitHub Pages compatible archive pages built with Liquid ~> type: liquid
# (default)
# - Jekyll Archives plugin archive pages ~> type: jekyll-archives
# Path (examples)
# - Archive page should exist at path when using Liquid method or you can
# expect broken links (especially with breadcrumbs enabled)
# - <base_path>/tags/my-awesome-tag/index.html ~> path: /tags/
# - <base_path/categories/my-awesome-category/index.html ~> path: /categories/
# - <base_path/my-awesome-category/index.html ~> path: /
category_archive:
type: liquid
path: /categories/
tag_archive:
type: liquid
path: /tags/
# https://github.com/jekyll/jekyll-archives
# jekyll-archives:
# enabled:
# - categories
# - tags
# layouts:
# category: archive-taxonomy
# tag: archive-taxonomy
# permalinks:
# category: /categories/:name/
# tag: /tags/:name/
# HTML Compression
# - http://jch.penibelst.de/
compress_html:
clippings: all
ignore:
envs: development
# Defaults
defaults:
- scope:
path: ""
type: docs
values:
layout: single
read_time: false
author_profile: false
share: false
comments: false
sidebar:
nav: docs

49
_data/navigation.yml Normal file
View file

@ -0,0 +1,49 @@
---
main:
- title: '
<a href="https://github.com/TheLocehiliosan/yadm/stargazers">
<img
src="https://img.shields.io/github/stars/TheLocehiliosan/yadm.svg?style=social"
alt="Stars">
</a>
'
- title: '
<a href="https://github.com/TheLocehiliosan/yadm/watchers">
<img
src="https://img.shields.io/github/watchers/TheLocehiliosan/yadm.svg?style=social"
alt="Watchers">
</a>
'
docs:
- title: Basics
children:
- title: "Overview"
url: /docs/overview
- title: "Installation"
url: /docs/install
- title: "Getting Started"
url: /docs/getting_started
- title: "Common Commands"
url: /docs/common_commands
- title: Advanced Features
children:
- title: "Bootstrap"
url: /docs/bootstrap
- title: "Alternate Files"
url: /docs/alternates
- title: "Templates"
url: /docs/templates
- title: "Encryption"
url: /docs/encryption
- title: "Hooks"
url: /docs/hooks
- title: More Help
children:
- title: "Upgrading from Version 1"
url: /docs/upgrade_from_1
- title: "FAQ"
url: /docs/faq
- title: "Example Dotfiles"
url: /docs/examples
- title: "Manual"
url: "https://github.com/TheLocehiliosan/yadm/blob/master/yadm.md"

5
_dev.yml Normal file
View file

@ -0,0 +1,5 @@
---
url: http://localhost:4000
analytics:
provider: false
gtm: false

41
_docs/010_overview.md Normal file
View file

@ -0,0 +1,41 @@
---
title: "Overview"
permalink: /docs/overview
---
<a name=""></a><!-- Anchor "#" used at the ends of pagination -->
> You've spent time tweaking your computing environment. Everything operates the
way you want. That's fantastic! Then your hard drive fails, and the computer
needs to be rebuilt. yadm can restore you configurations.
> You get a new computer, and you want to recreate that environment. You
probably want to keep both machines' configurations in sync. yadm can help
you coordinate the configurations between your machines.
> You begin experimenting with new changes to your configurations, and now
everything is broken. yadm can help you determine what changed or simply
revert all of your changes.
yadm is like having a version of Git, that only operates on your dotfiles.
If you know how to use Git, you already know how to use yadm.
* It doesn't matter if your current directory is another Git-managed repository
* You don't have to move your dotfiles, or have them symlinked from another
location.
* yadm automatically inherits all of Git's features, allowing you to branch,
merge, rebase, use submodules, etc.
As so many others, I started out with a repository of dotfiles and a few scripts
to symbolically link them around my home directory. This quickly became
inadequate and I looked for solutions elsewhere. I've tried other tools, but I
didn't find all of the features I personally wished for in a single tool. This
led to yadm being written with the following goals:
* Use a single repository
* Few dependencies
* Ability to use alternate files based on OS or host
* Ability to encrypt and track confidential files
* Stay out of the way and let Git do what it's good at
Follow these links to [install](install) yadm
or
learn some simple steps for [getting started](getting_started) with yadm.

119
_docs/020_install.md Normal file
View file

@ -0,0 +1,119 @@
---
title: "Installation"
permalink: /docs/install
toc: true
toc_label: "Platforms"
---
## OSX
yadm can be installed using [Homebrew][homebrew].
```
brew install yadm
```
## RPM Based Installations
For RPM based systems like Fedora, Red Hat, CentOS, openSUSE, etc, there are
repositories hosted by openSUSE Build Service.
Follow this link for [repositories and installation instructions][OBS].
## Ubuntu/Debian
A version of yadm is available via standard package repositories. Use `apt-get` to install.
## Arch Linux
yadm is available in the [Arch User Repos](https://wiki.archlinux.org/index.php/Arch_User_Repository) and can be installed with an [AUR helper](https://wiki.archlinux.org/index.php/AUR_helpers) or with [Makepkg](https://wiki.archlinux.org/index.php/Makepkg).
```
yay -Syu yadm-git
```
## Gentoo Linux
yadm is available in the main gentoo portage tree, simply use `emerge` to install it.
```
emerge -atv app-admin/yadm
```
## Void Linux
yadm is available in the official repository, simply use `xbps-install` to install it.
```
xbps-install yadm
```
## FreeBSD
yadm is available in the FreeBSD ports. Use `pkg` to install it from a prebuilt binary package:
```
pkg install yadm
```
## Download
You *can* simply download the yadm script and put it into your `$PATH`. Something like this:
```
curl -fLo /usr/local/bin/yadm https://github.com/TheLocehiliosan/yadm/raw/master/yadm && chmod a+x /usr/local/bin/yadm
```
Of course, you can change the file paths above to be appropriate for your `$PATH` and situation.
## Clone
You might wish to clone the yadm project and symlink `yadm` into your
`$PATH`.
```
git clone https://github.com/TheLocehiliosan/yadm.git ~/.yadm-project
ln -s ~/.yadm-project/yadm ~/bin/yadm
```
Now you can pull the latest updates to yadm using Git. Again, adjust the
file paths above to be appropriate for your `$PATH` and situation.
## Submodule
If you are comfortable with how Git submodules work, another option is to add
the yadm project as a submodule and symlink `yadm` into your `$PATH`.
```
cd ~
yadm submodule add https://github.com/TheLocehiliosan/yadm.git .yadm-project
yadm submodule update --init --recursive
ln -s ~/.yadm-project/yadm ~/bin/yadm
yadm add .yadm-project .gitmodules bin/yadm
yadm commit
```
When using submodules, you need to initialize them each time you do a fresh
`clone` of your dotfiles.
```
yadm submodule update --init --recursive
```
Updating to a newer version of yadm would use commands similar to this.
```
cd ~/.yadm-project
git pull
yadm add ~/.yadm-project
yadm commit
```
Again, adjust the file paths above to be appropriate for your `$PATH` and
situation.
You can find more information about Git submodules by reading the
[git-submodule][git-submodule] man page.
[OBS]: https://software.opensuse.org//download.html?project=home%3ATheLocehiliosan%3Ayadm&package=yadm
[git-submodule]: https://git-scm.com/docs/git-submodule
[homebrew]: https://github.com/Homebrew/homebrew

View file

@ -0,0 +1,34 @@
---
title: "Getting Started"
permalink: /docs/getting_started
---
Starting out with yadm should be just a few easy steps.
### If you don't currently have a repository
Start out with an empty local repository
yadm init
yadm add <important file>
yadm commit
Eventually you will want to push the local repo to a remote.
yadm remote add origin <url>
yadm push -u origin master
### If you have an existing remote repository
Clone your existing repo using yadm.
yadm clone <url>
yadm status
The `clone` command will attempt to `merge` your existing repository, but if it
fails, it will `stash` any conflicting data. See
[this question](faq#i-just-cloned-my-repository-and-conflicting-data-was-overwritten-why)
in the FAQ if you need help.
---
That's all it takes to start. Now most Git commands can be used as
`yadm <git command>`.
Read about [common commands](common_commands) for ideas.

68
_docs/040_common_usage.md Normal file
View file

@ -0,0 +1,68 @@
---
title: "Common Commands"
permalink: /docs/common_commands
---
Most of these operations will look like Git commands; because they are.
yadm wraps Git, allowing it to perform all of Git's operations. The
difference is your `$HOME` directory becomes the working directory, and you can
run the commands from any directory.
Commands below which are special to yadm are denoted with
<i class="fa fa-fw fa-asterisk" aria-hidden="true"></i>,
and those which are passed directly through to Git are denoted with
<i class="fab fa-fw fa-git-square" aria-hidden="true"></i>.
<i class="fa fa-fw fa-asterisk" aria-hidden="true"></i> `man yadm`
: Display yadm's
[manual](https://github.com/TheLocehiliosan/yadm/blob/master/yadm.md).
<i class="fab fa-fw fa-git-square" aria-hidden="true"></i> `yadm status`
: Show the repository status; added, changed, removed files. Because a `$HOME`
directory often more than only dotfiles, by default
yadm ignores untracked files when displaying status.
<i class="fab fa-fw fa-git-square" aria-hidden="true"></i> `yadm push`, `yadm fetch`
: Send or retrive commits to/from your remote repository .
<i class="fab fa-fw fa-git-square" aria-hidden="true"></i> `yadm commit --amend`
: Replace the last commit with a new one. Allows you to change your commit
message or add staged changes to the previous commit.
<i class="fab fa-fw fa-git-square" aria-hidden="true"></i> `yadm diff`
: View changes (uncommitted) you've made to your dotfiles.
<i class="fab fa-fw fa-git-square" aria-hidden="true"></i> `yadm diff --cached`
: View changes staged with `yadm add`. These changes will be added with the next
commit.
<i class="fa fa-fw fa-asterisk" aria-hidden="true"></i> `yadm list -a`
: Print a list of files managed by yadm. The -a option will cause all managed
files to be listed. Otherwise, the list will only include files from the
current directory or below.
<i class="fa fa-fw fa-asterisk" aria-hidden="true"></i> `yadm alt`
: Create symbolic links for any managed files matching the alternate naming rules.
Read about [alternate files](alternates) for more details.
<i class="fa fa-fw fa-asterisk" aria-hidden="true"></i> `yadm encrypt`
: Encrypt all files matching the patterns found in `$HOME/.config/yadm/encrypt`. Read
about [encryption](encryption) for more details.
<i class="fa fa-fw fa-asterisk" aria-hidden="true"></i> `yadm decrypt`, `yadm decrypt -l`
: Decrypt files stored in `$HOME/.config/yadm/files.gpg`. Using the `-l` option will
only list the files (without decrypting them). Read about
[encryption](encryption) for more details.
<i class="fa fa-fw fa-asterisk" aria-hidden="true"></i> `yadm clone --bootstrap <URL>`
: Clone the repository from `<URL>`, and automatically run bootstrap if
successful. Read about [bootstrap](bootstrap) for more details.
<i class="fab fa-fw fa-git-square" aria-hidden="true"></i> `yadm remote -v`
: Display detailed information about all configured remote repositories.
<i class="fab fa-fw fa-git-square" aria-hidden="true"></i> `yadm checkout -- <file>`
: Abandon local changes to `<file>`, replacing it with the `HEAD` revision of
`<file>`.
<i class="fab fa-fw fa-git-square" aria-hidden="true"></i> `yadm checkout -b <branch-name>`
: Create a branch called `<branch-name>`, and check the branch out.

172
_docs/050_bootstrap.md Normal file
View file

@ -0,0 +1,172 @@
---
title: "Bootstrap"
permalink: /docs/bootstrap
---
Often there is more to set up once your dotfiles repository has been cloned. For
example, if your repository has submodules, you may wish to initialize them. On
MacOS, you may wish to install Homebrew and process a `.Brewfile`. These types
of additional steps are generally referred to as "bootstrapping".
Though everyone may have a different set of bootstrap operations they need to
perform, yadm has a standard command for executing them.
yadm bootstrap
This command will execute the program named `$HOME/.config/yadm/bootstrap`. You must
provide this program yourself, and it must be made executable. But those are the
only constraints.
After yadm successfully clones a repository, if there is a bootstrap program
available, it will offer to run it for you.
Found .config/yadm/bootstrap
It appears that a bootstrap program exists.
Would you like to execute it now? (y/n)
You can prevent this prompting by using the `--bootstrap` or `--no-bootstrap`
options when cloning.
It is best to make the logic of your bootstrap idempotent—allowing it to be
re-run in the future when you merge changes made on other hosts.
## Examples
Curious about the possibilities? See some examples below. These are all written
in Bash, but you can use any executable file as a bootstrap.
### Initialize submodules
If you've added repositories as submodules for the yadm repository, you can
initialize them after a successful clone.
```bash
#!/bin/sh
# Because Git submodule commands cannot operate without a work tree, they must
# be run from within $HOME (assuming this is the root of your dotfiles)
cd "$HOME"
echo "Init submodules"
yadm submodule update --recursive --init
```
### Install [Homebrew](http://brew.sh/) and a bundle of recipes
```bash
#!/bin/sh
system_type=$(uname -s)
if [ "$system_type" = "Darwin" ]; then
# install homebrew if it's missing
if ! command -v brew >/dev/null 2>&1; then
echo "Installing homebrew"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
if [ -f "$HOME/.Brewfile" ]; then
echo "Updating homebrew bundle"
brew bundle --global
fi
fi
```
### Configure [iTerm2](http://www.iterm2.com/) to use your configuration
```bash
#!/bin/sh
system_type=$(uname -s)
if [ "$system_type" = "Darwin" ]; then
# possibly add something here to ensure iTerm2 is installed using Homebrew
# cask like in the previous example
if [ -d "$HOME/.iterm2" ]; then
echo "Setting iTerm preference folder"
defaults write com.googlecode.iterm2 PrefsCustomFolder "$HOME/.iterm2"
fi
fi
```
### Compile a custom terminfo file
```bash
#!/bin/sh
if [ -f "$HOME/.terminfo/custom.terminfo" ]; then
echo "Updating terminfo"
tic "$HOME/.terminfo/custom.terminfo"
fi
```
### Update the yadm repo origin URL
You might initially clone your repo using `https`, but ssh configurations may be
available after cloning. If so, you could update the yadm repo origin to use
`ssh` instead.
```bash
#!/bin/sh
echo "Updating the yadm repo origin URL"
yadm remote set-url origin "git@github.com:MyUser/dotfiles.git"
```
### Install [vim](http://www.vim.org/) plugins managed with [vim-plug](https://github.com/junegunn/vim-plug)
vim-plug can be used in your `.vimrc` to enable plugins. The example here will
automatically download vim-plug and run the `:PlugInstall` command if
vim-plug is missing when vim starts.
```vim
" download vim-plug if missing
if empty(glob("~/.vim/autoload/plug.vim"))
silent! execute '!curl --create-dirs -fsSLo ~/.vim/autoload/plug.vim https://raw.github.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * silent! PlugInstall
endif
" declare plugins
silent! if plug#begin()
Plug 'airblade/vim-gitgutter'
Plug 'c9s/perlomni.vim', { 'for': 'perl' }
Plug 'ctrlpvim/ctrlp.vim'
Plug 'vim-syntastic/syntastic'
Plug 'yggdroot/indentLine'
" ignore these on older versions of vim
if v:version >= 703
Plug 'gorodinskiy/vim-coloresque'
Plug 'jamessan/vim-gnupg'
endif
if v:version >= 704
Plug 'vim-pandoc/vim-pandoc-syntax'
endif
call plug#end()
endif
```
You can enhance this scheme by having your bootstrap program initialize
vim-plug when you clone, instead of when you first run vim. This example
will install any new plugins, and also remove any plugins now deleted from your
`.vimrc`.
```bash
#!/bin/sh
if command -v vim >/dev/null 2>&1; then
echo "Bootstraping Vim"
vim '+PlugUpdate' '+PlugClean!' '+PlugUpdate' '+qall'
fi
```
---
_If you have suggestions for useful bootstrapping logic, let me know..._

183
_docs/060_alternates.md Normal file
View file

@ -0,0 +1,183 @@
---
title: "Alternate Files"
permalink: /docs/alternates
---
When possible, it is best to use the same files across all systems. However,
there are occasions when you need different files in some places. Below are
features and strategies for dealing with those occasions.
## Symlink alternates
It can be useful to have an automated way of choosing an alternate version of a
file for a different operating system, host, user, etc.
yadm will automatically create a symbolic link to the appropriate version of a
file, when a valid suffix is appended to the filename. The suffix contains the
conditions that must be met for that file to be used.
The suffix begins with `##`, followed by any number of conditions separated by
commas.
##<condition>[,<condition>,…]
Each condition is an attribute/value pair, separated by a period. Some
conditions do not require a "value", and in that case, the period and value can
be omitted. Most attributes can be abbreviated as a single letter.
| Attribute | Meaning |
| - | - |
| `template`, `t` | Valid when the value matches a supported template processor. See the [Templates](/docs/templates) section for more details.|
| `user`, `u` | Valid if the value matches the current user. Current user is calculated by running <code>id&nbsp;&#8209;u&nbsp;&#8209;n</code>. |
| `distro`, `d` | Valid if the value matches the distro. Distro is calculated by running <code>lsb_release&nbsp;&#8209;si</code>. |
| `os`, `o` | Valid if the value matches the OS. OS is calculated by running <code>uname&nbsp;&#8209;s</code>. <sup>*</sup> |
| `class`, `c` | Valid if the value matches the local.class configuration. Class must be manually set using <code>yadm&nbsp;config&nbsp;local.class&nbsp;&lt;class&gt;</code>. |
|`hostname`, `h`|Valid if the value matches the short hostname. Hostname is calculated by running `hostname`, and trimming off any domain.|
|`default`|Valid when no other alternate is valid.|
<sub><sup>*
The OS for "Windows Subsystem for Linux" is reported as "WSL", even though uname identifies as "Linux".
</sup></sub>
You may use any number of conditions, in any order. An alternate will only be
used if _ALL_ conditions are valid. For all files managed by yadm's repository
or listed in `$HOME/.config/yadm/encrypt`, if they match this naming convention,
symbolic links will be created for the most appropriate version.
The "most appropriate" version is determined by calculating a score for each
version of a file. A [template](/docs/templates) is always scored higher than
any symlink condition. The number of conditions is the next largest factor in
scoring. Files with more conditions will always be favored. Any invalid
condition will disqualify that file completely.
If you don't care to have all versions of alternates stored in the same
directory as the generated symlink, you can place them in the
`$HOME/.config/yadm/alt` directory. The generated symlink or processed template
will be created using the same relative path.
Alternate linking may best be demonstrated by example. Assume the following
files are managed by yadm's repository:
$HOME/path/example.txt##default
$HOME/path/example.txt##class.Work
$HOME/path/example.txt##os.Darwin
$HOME/path/example.txt##os.Darwin,hostname.host1
$HOME/path/example.txt##os.Darwin,hostname.host2
$HOME/path/example.txt##os.Linux
$HOME/path/example.txt##os.Linux,hostname.host1
$HOME/path/example.txt##os.Linux,hostname.host2
If running on a Macbook named `host2`, yadm will create a symbolic link which looks like this:
`$HOME/path/example.txt``$HOME/path/example.txt##os.Darwin,hostname.host2`
However, on another Mackbook named `host3`, yadm will create a symbolic link which looks like this:
`$HOME/path/example.txt``$HOME/path/example.txt##os.Darwin`
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:
`$HOME/path/example.txt``$HOME/path/example.txt##os.Linux`
If running on a Solaris server, the link will use the default version:
`$HOME/path/example.txt``$HOME/path/example.txt##default`
If running on a system, with class set to `Work`, the link will be:
`$HOME/path/example.txt``$HOME/path/example.txt##class.Work`
If no `##default` version exists and no files have valid conditions, then no
link will be created.
Links are also created for directories named this way, as long as they have at
least one yadm managed file within them.
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`.
## Class and Overrides
Class is a special value which is stored locally on each host (inside the local
repository). To use alternate symlinks using `##class.<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
`local.class` to be "Work".
yadm config local.class Work
Similarly, the values of `os`, `hostname`, and `user` can be manually overridden
using the configuration options `local.os`, `local.hostname`, and `local.user`.
## Templates
Templates are another powerful tool for creating alternate content on each host.
See the [Templates](/docs/templates) documentation for full details.
## Strategies for alternate files on different systems
Where possible, you should try to use the same file on every system. Here are a few examples:
### .vimrc
```vim
let OS=substitute(system('uname -s'),"\n","","")
if (OS == "Darwin")
" do something that only makes sense on a Mac
endif
```
### .tmux.conf
# use reattach-to-user-namespace as the default command on OSX
if-shell "test -f /usr/local/bin/reattach-to-user-namespace" 'set -g default-command "reattach-to-user-namespace -l bash"'
### .bash_profile
```bash
system_type=$(uname -s)
if [ "$system_type" = "Darwin" ]; then
eval $(gdircolors $HOME/.dir_colors)
else
eval $(dircolors -b $HOME/.dir_colors)
fi
```
### .gitconfig
However, sometimes the type of file you are using doesn't allow for this type of
logic. If a configuration can do an "_include_", you can include a specific
alternate version using yadm. Consider these three files:
`.gitconfig`
```ini
[log]
decorate = short
abbrevCommit = true
[include]
path = .gitconfig.local
```
`.gitconfig.local##os.Darwin`
```ini
[user]
name = Tim Byrne
email = tim@personal.email.org
```
`.gitconfig.local##os.Linux`
```ini
[user]
name = Dr. Tim Byrne
email = dr.byrne@work.email.com
```
Configuring Git this way includes `.gitconfig.local` in the standard
`.gitconfig`. yadm will automatically link the correct version based on the
operating system. The bulk of your configurations can go in a single file, and
you just put the exceptions in OS-specific files.

104
_docs/070_templates.md Normal file
View file

@ -0,0 +1,104 @@
---
title: "Templates"
permalink: /docs/templates
---
Templates are a special kind of [alternate](/docs/alternates) file. The template
content and host specific data are combined as input to a template processor
which produces a new file as its output.
This can be very useful if you need to vary a small part of a file, but it
doesn't support any kind of include directive.
## Template suffixes
To create a template, append an alternate suffix to the file name.
The suffix has the format:
##template.<template processor>
<sub><sup>
"template" can also be shortened to "t".
</sup></sub>
The supported template processors are:
| Processor | Suffixes | Dependencies |
| - | - | - |
| default | `##template`, `##template.default` | `awk` must be installed. (This should be installed on all *nix systems) |
| j2cli | `##template.j2`, `##template.j2cli` | `j2cli` must be installed. |
| envtpl | `##template.j2`, `##template.envtpl` | `envtpl` must be installed. |
The processor can be omitted for "default".
Also, `j2` will be processed by either j2cli or envtpl, whichever is found.
## Exposed data
When template processors run, they will be provided the following set of data.
| Default (built-in) | Jinja | Description | Source |
| - | - | - | - |
| `yadm.class` | `YADM_CLASS` | Locally defined yadm class | <code>yadm&nbsp;config&nbsp;local.class</code> |
| `yadm.distro` | `YADM_DISTRO` | Distribution | <code>lsb_release&nbsp;&#8209;si</code> |
| `yadm.hostname` | `YADM_HOSTNAME` | Hostname | `hostname` (without domain) |
| `yadm.os` | `YADM_OS` | Operating system | <code>uname&nbsp;&#8209;s</code> <sup>*</sup> |
| `yadm.user` | `YADM_USER` | Current user | <code>id&nbsp;&#8209;u&nbsp;&#8209;n</code> |
| `yadm.source` | `YADM_SOURCE` | Template filename | (fully qualified path) |
<sub><sup>*
The OS for "Windows Subsystem for Linux" is reported as "WSL", even though uname identifies as "Linux".
</sup></sub>
## Supported template processors
default
: This built-in processor requires no additional software (assuming your distro
contains `awk`). This processor has a syntax _similar_ to the Jinja processors
below, however it only supports a small set of directives. Those directives are
detailed in the section below.
j2cli
: [j2cli][j2cli] (or `j2`) is a Python-based Jinja2 template processor. This
fully supports all directives of the [Jinja2 library][jinja]. When your template is
processed, the YADM_* values are provided to j2cli as environment variables.
envtpl
: [envtpl][envtpl] is another Python-based Jinja2 template processor. Online
comments suggest this software might not be maintained anymore.
## Built-in directives
yadm's "default" (built-in) template processor supports the following directives.
{% raw %}
variables
: Variables should be surrounded by `{{ }}`. It is fine for there to be
whitespace between the variable name and the double braces. The `{{` and
`}}` must be on the same line. For example:
```jinja
# WARNING: Do not edit this file.
# It was generated by processing {{ yadm.source }}
```
if-else-endif
: Entire blocks of content can be included or excluded based on the value of a
variable. Only equality can be tested. These blocks must start with
`{% if yadm.variable == "value" %}` and end with `{% endif %}`. An alternative
block can also be specified using the directive `{% else %}`. These directives
must appear on lines by themselves. They may not appear on the same line. The
"if" directive only supports testing a single variable, and there is no "elif"
directive as there is in Jinja. Here is an example.
```jinja
{% if yadm.os == "Darwin" %}
This block is included for MacOS
{% else %}
This block is included for for any other OS
{% endif %}
```
{% endraw %}
[envtpl]: https://github.com/andreasjansson/envtpl
[j2cli]: https://github.com/kolypto/j2cli
[jinja]: https://jinja.palletsprojects.com

51
_docs/080_encryption.md Normal file
View file

@ -0,0 +1,51 @@
---
title: "Encryption"
permalink: /docs/encryption
---
It can be useful to manage confidential files, like SSH keys, across multiple
systems. However, doing so would put plain text data into a Git repository,
which often resides on a public system. yadm implements a feature which can
make it easy to encrypt and decrypt a set of files so the encrypted version can
be maintained in the Git repository. This feature will only work if the gpg
command is available.
_It is recommended that you use a private repository when keeping confidential
files, even though they are encrypted._
To use this feature, a list of patterns must be created and saved as
`$HOME/.config/yadm/encrypt`. For example:
.ssh/*.key
The `yadm encrypt` command will find all files matching the patterns, and
prompt for a password. Once a password has confirmed, the matching files will be
encrypted and saved as `$HOME/.config/yadm/files.gpg`. The patterns and files.gpg
should be added to the yadm repository so they are available across multiple
systems.
yadm add .config/yadm/encrypt
yadm add .config/yadm/files.gpg
To decrypt these files later, or on another system run `yadm decrypt` and
provide the correct password.
_By default, any decrypted files will have their "group" and "others"
permissions removed._
### Asymmetric Encryption
Symmetric encryption is used by default, but asymmetric encryption may
be enabled using the `yadm.gpg-recipient` configuration. To do so, run:
yadm config yadm.gpg-recipient <recipient-address>
For this to work, `<recipient-address>` must exist in your gpg keyrings.
## git-crypt
git-crypt is a tool that enables transparent encryption and decryption of files
in a Git repository. If git-crypt is installed, you can use it with your yadm
repository.
Simply use it normally, prefacing the `git-crypt` commands with `yadm`.
You can learn more about [git-crypt](https://github.com/AGWA/git-crypt) at this
[website](https://www.agwa.name/projects/git-crypt/).

40
_docs/090_hooks.md Normal file
View file

@ -0,0 +1,40 @@
---
title: "Hooks"
permalink: /docs/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/.config/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
(Parameters are space delimited, and any space, tab or backslash will be
escaped with a backslash. An example of parsing this variable with Bash can be
found [here][parse-example].)
YADM_HOOK_REPO
: The path to the yadm repository
YADM_HOOK_WORK
: The path to the work-tree
[parse-example]: https://github.com/TheLocehiliosan/yadm/blob/master/contrib/hooks/parsing_full_command_example/pre_log

63
_docs/100_upgrade.md Normal file
View file

@ -0,0 +1,63 @@
---
title: "Upgrading from Version 1"
permalink: /docs/upgrade_from_1
---
Beginning with version 2.0.0, yadm introduced a few major changes which may
require you to adjust your configurations.
If you want to retain yadm's old behavior until you transition your
configurations, you can set an environment variable `YADM_COMPATIBILITY=1`.
Doing so will automatically use the old yadm directory, and process alternates the same as version 1.
This compatibility mode is deprecated, and will be removed in future versions.
This mode exists solely for transitioning to the new paths and naming of alternates.
## New yadm directory location
yadm now uses the [XDG Base Directory Specification][xdg-spec] to find its configurations.
For the majority of users, this means configurations will now be in
`$HOME/.config/yadm` instead of the old location of `$HOME/.yadm`.
You can customize the base directory by specifying an environment variable
named `XDG_CONFIG_HOME`.
If you previously had configurations in `$HOME/.yadm`, the easiest way
to migrate is to use the new `yadm upgrade` command. This command will move your
existing repo and configurations to the new directory, and rename any yadm
configurations that are tracked by your repo. Upgrading will also re-initialize
all submodules you have added (otherwise they will be broken when the repo
moves).
## New alternate file naming convention
The naming conventions for alternate files have been changed.
Read full details about the new naming convention [here](/docs/alternates).
This table of examples should help you understand how to translate old filenames
to new ones.
| Conditions | Old suffix | New suffix |
| - | - | - |
| Default file | `##` | `##default` |
| MacOS host | `##Darwin` | `##o.Darwin` |
| yadm.class = "work" | `##work` | `##c.work` |
| Linux host named "dromio" | `##Linux.dromio` | `##o.Linux,h.dromio` |
| Linux host named "dromio" with user named "antipholus" | `##Linux.dromio.antipholus` | `##o.Linux,h.dromio,u.antipholus` |
| Host named "luciana" | `##%.luciana` | `##h.luciana` |
| Any Linux host with user named "egeon" | `##Linux.%.egeon` | `##o.Linux,u.egeon` |
| User named "balthazar" | `##%.%.balthazar` | `##u.balthazar` |
| A Jinja template | `##yadm.j2` | `##template.j2` |
## Built-in template processing
Older versions supported Jinja templates if envtpl was installed. New versions
support _multiple_ template processors, including a built-in processor. The
built-in processor has a limited feature set, but should be sufficient for most
users needs (without having to install additional software). Read full details
[here](/docs/templates).
## Option `yadm.cygwin-copy` changed to `yadm.alt-copy`
Older versions supported a `yadm.cygwin-copy` option, because some software
doesn't work well with CYGWIN symlinks. Now that option has been renamed to
`yadm.alt-copy`, and can be used on any system, not just CYGWIN. So if you have
a system which doesn't fully support symlinks, you can have alternates created
as files instead.
[xdg-spec]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

222
_docs/110_faq.md Normal file
View file

@ -0,0 +1,222 @@
---
title: "Frequently Asked Questions"
permalink: /docs/faq
# TOC levels is dictated by toc_levels in _config.yml
# Update to front-matter TOC after upgrading MMistakes
---
{% include toc title="Categories" %}
## Usage
### I just cloned my repository and conflicting data was overwritten. Why?
Prior to cloning your repository, files managed by yadm already existed. For
example, imagine you are logged into a system and `$HOME/.bash_profile` already
exists. If you then clone your yadm repository—which also contains
`.bash_profile`—then you will likely get a conflict. Since version 1.07,
yadm responds by "stashing" these conflicts. To view the stashed data, you can
run `yadm stash show -p` from within your `$HOME` directory. If you want to
restore the stashed data, you can run `yadm stash apply` from within your
`$HOME` directory.
### While committing I got the message, _"Please tell me who you are"_. Why?
Whenever a Git commit is generated, Git requires information about the author of
the commit. This can be configured via the `git config` command. Usually the
best approach is to configure this information globally, and then manage your
global Git configuration via yadm. This allows the configuration to follow
you wherever your dotfiles live.
```
git config --global "user.email" "your-email@domain"
git config --global "user.name" "Your Name"
yadm add ~/.gitconfig
```
However, if you want commits to your yadm repo to use a different author,
you can configure these settings in the yadm repo itself.
```
yadm gitconfig "user.email" "alternate-email@domain"
yadm gitconfig "user.name" "Alternate Name"
```
Note: Configuring these settings directly in the yadm repo will require you
to configure it each time you clone the repo.
### How can I display untracked files with a `yadm status` command?
By default, yadm is configured to ignore untracked files when displaying a
status. You can use the `-u` paramter on the status command to alter how
untracked files are treated. `-unormal` will show untracked files and
directories.
```
yadm status -unormal
```
If you want to change the default treatment, you can change this configuration
on the yadm repository itself.
```
yadm gitconfig --unset status.showUntrackedFiles
```
### How can I stage all modified files at once?
Just as with Git, you can use the `add` command.
```
yadm add -u :/
```
(Starting with Git 2.0, the `:/` is not necessary)
### How can I change the URL of my remote yadm repository?
This is done the same way you change the URL of any Git repository.
```
yadm remote set-url origin <NEW-URL>
```
This could be useful if you manage your ssh keys in the yadm repository.
That could make it difficult to initially clone the repository using the `ssh`
protocol. You can start by cloning the repository using the `https` protocol
(and providing a password), and then change the repository's URL after you've
decrypted your ssh keys.
### I've customized yadm configurations (stored in `~/.config/yadm/config`). Should I add that to my repository?
Certainly. That is a good way to carry your yadm configurations around (just
like the rest of your dotfiles).
### Can you point to any example yadm managed repositories?
[This page](examples) contains some examples.
## Bootstrapping
### Do I need to write my bootstrap in Bash?
No. Any executable file can be used as a bootstrap. It's up to you to decide
what works best.
### I've created a bootstrap program. Should I add that to my repository?
Absolutely. That will allow your bootstrap program to be executed each time you
clone your repository. Read [bootstrap](bootstrap) for more details.
## Encryption
### Can I use yadm without gpg?
Of course. You only need `gpg` installed if you plan on using the
encrypt/decrypt features. yadm will tell you if it is missing a dependency
for any command.
### Should I `yadm add` my `.config/yadm/encrypt` file?
Yes! This way your configuration for what files should be encrypted will follow
you when you clone your repository.
### Should I `yadm add` encrypted files to repository?
No, you should not. Files you want encrypted should be added to the file
`.config/yadm/files.gpg` using the `yadm encrypt` command. Then
`.config/yadm/files.gpg` should be added to the yadm repository. This way, only
an encrypted collection of those files are put into the repository. After
cloning or updating your repository, you can use `yadm decrypt` to extract those
files from `.config/yadm/files.gpg`. See the
[encryption help](encryption) for more details.
### I modified an encrypted file, but yadm doesn't show any modifications. Why?
If you changed files which are matched by `.config/yadm/encrypt`, you must
re-run `yadm encrypt` to generate a new version of `.config/yadm/files.gpg`.
Then `.config/yadm/files.gpg` can be added to a new commit.
### Why do I get the error `Inappropriate ioctl for device` when encrypting.
If you get the error
`command get_passphrase failed: Inappropriate ioctl for device`
when running `yadm encrypt`, gpg is having trouble identifying the tty to
use. The environment variable `GPG_TTY` can be used to help gpg out. Export
this variable to your shell in your login scripts.
```
export GPG_TTY=$(tty)
```
### Can I use yadm and git-crypt?
Yes, yadm now supports git-crypt. Read more [here](/docs/encryption#git-crypt).
## Directory Creation
### Why are `.ssh` or `.gnupg` directories being created by yadm?
yadm is often used to track private data used by SSH and GnuPG. Because of this,
these directories are created with restricted permissions prior to Git
operations that could write data to those directories. This is to better protect
that sensitive data.
If you want to disable that feature, you can set the `auto-private-dirs`
configuration by running:
```
yadm config yadm.auto-private-dirs false
```
## Unconventional Cases
### Can I use yadm to track system level files?
yadm only manages files within the configured worktree (`$HOME` by default).
Also, yadm will use the effective user for file ownership just like Git.
However, if you want to bend yadm into managing system files, one method is:
```
# create an alias to run yadm for system files
alias sysyadm="sudo yadm -Y /etc/yadm"
# initialize the yadm repo using the worktree of "/"
sysyadm init -w /
# continue to use sysyadm for managing system files
sysyadm add /etc/something.conf
sysyadm commit -m 'Add something.conf'
```
Assuming you have "sudo" rights, the `sysyadm` alias will work as if root was using
yadm, having the owner be "root", with the ability to manage any file under `/`.
If you were only interested in managing files under `/etc`, you could use that as
the worktree instead.
## Comparisons
### How does yadm differ from homeshick?
yadm and homeshick are both written in Bash, with very limited
dependencies. However, homeshick works by symlinking data from a repository
working directory into your `$HOME` directory. yadm instead uses your
`$HOME` directory _as_ its working directory. homeshick allows for multiple
"castles" to be linked into `$HOME`, while yadm is designed to work with a
single repository. homeshick requires you to change into the "castle"
directory before performing any Git based commands. yadm allows you to
perform operations regardless of your location. yadm also includes unique
features to encrypt private data, and symlink alternate versions of files based
on OS type or hostname.
### How does yadm differ from vcsh?
yadm and vcsh both work as a filters for standard Git commands. Both
also use your `$HOME` directory _as_ the repository's working directory.
However, vcsh is designed to work with multiple repositories, yadm
instead uses a single repository. vcsh requires you to specify which
repository you want to operate on, while yadm only operates on one. If you
want to use Git submodules, you _may_ have trouble using vcsh. This is
because only one repository can be the owner of the `.gitmodules` file.
yadm also includes unique features to encrypt private data, and symlink
alternate versions of files based on OS type or hostname.

23
_docs/120_examples.md Normal file
View file

@ -0,0 +1,23 @@
---
title: "Example Dotfiles"
permalink: /docs/examples
---
<a name=""></a><!-- Anchor "#" used at the ends of pagination -->
Need some inspiration? Here are some public dotfiles repositories managed by
yadm. Drop me a line if you have a dotfiles repo you'd like added to this
list.
* [Search github for repos tagged with `yadm`](https://github.com/search?q=topic%3Ayadm&type=Repositories)
* [DoomHammer/dotfiles](https://github.com/DoomHammer/dotfiles)
* [SShrike/dotfiles](https://github.com/SShrike/dotfiles)
* [akatrevorjay/dotfiles](https://github.com/akatrevorjay/dotfiles)
* [akupila/dotfiles](https://github.com/akupila/dotfiles)
* [bjartek/dotfiles](https://github.com/bjartek/dotfiles)
* [cschooley/dotfiles](https://github.com/cschooley/dotfiles)
* [esphen/dotfiles](https://github.com/esphen/dotfiles)
* [gverilla/dotfiles](https://github.com/gverilla/dotfiles)
* [mago0/dotfiles](https://github.com/mago0/dotfiles)
* [mes5k/dotfiles](https://github.com/mes5k/dotfiles)
* [pendowski/dotfiles](https://github.com/pendowski/dotfiles)
* [tonipes/dotfiles](https://github.com/tonipes/dotfiles)

6
_includes/body.html Normal file
View file

@ -0,0 +1,6 @@
{% if site.gtm %}
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id={{ site.gtm }}"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
{% endif %}

20
_includes/footer.html Normal file
View file

@ -0,0 +1,20 @@
<div class="page__footer-follow">
<ul class="social-icons">
{% if site.data.ui-text[site.locale].follow_label %}
<li><strong>{{ site.data.ui-text[site.locale].follow_label }}</strong></li>
{% endif %}
{% if site.footer.links %}
{% for link in site.footer.links %}
{% if link.label and link.url %}
<li><a href="{{ link.url }}" rel="nofollow noopener noreferrer"><i class="{{ link.icon | default: 'fas fa-link' }}" aria-hidden="true"></i> {{ link.label }}</a></li>
{% endif %}
{% endfor %}
{% endif %}
<!-- removed feed -->
</ul>
</div>
<div class="page__footer-copyright">&copy; 2015-{{ site.time | date: '%Y' }} {{ site.name | default: site.title }}. {{ site.data.ui-text[site.locale].powered_by | default: "Powered by" }} <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>

View file

@ -0,0 +1,14 @@
<!-- start custom footer snippets -->
<div id="quoteline"></div>
<script language="JavaScript">
var quote = new Array ();
quote[0] = ["A house that does not have one warm, comfy chair in it is soulless.", "May Sarton"];
quote[1] = ["Home is an invention on which no one has yet improved.", "Ann Douglas"];
quote[2] = ["Seek home for rest, for home is best.", "Thomas Tusser"];
quote[3] = ["I would not change my blest estate for all the world calls good or great.", "Isaac Watts"];
quote[4] = ["To feel at home, stay at home.", "Clifton Fadiman"];
quote[5] = ["We shape our dwellings, and afterwards our dwellings shape us.", "Winston Churchill"];
var i = Math.floor(quote.length*Math.random());
document.getElementById('quoteline').innerHTML = '<i>'+quote[i][0]+'</i>&mdash;'+quote[i][1];
</script>
<!-- end custom footer snippets -->

View file

@ -0,0 +1,13 @@
<!-- start custom head snippets -->
{% if site.gtm %}
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','{{ site.gtm }}');</script>
<!-- End Google Tag Manager -->
{% endif %}
<!-- end custom head snippets -->

43
_layouts/default.html Normal file
View file

@ -0,0 +1,43 @@
---
---
<!doctype html>
<!--
Minimal Mistakes Jekyll Theme 4.15.2 by Michael Rose
Copyright 2013-2019 Michael Rose - mademistakes.com | @mmistakes
Free for personal and commercial use under the MIT license
https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE
-->
<html lang="{{ site.locale | slice: 0,2 | default: "en" }}" class="no-js">
<head>
{% include head.html %}
{% include head/custom.html %}
</head>
<body class="layout--{{ page.layout | default: layout.layout }}{% if page.classes or layout.classes %}{{ page.classes | default: layout.classes | join: ' ' | prepend: ' ' }}{% endif %}">
{% include body.html %}
{% include_cached browser-upgrade.html %}
{% include_cached masthead.html %}
<div class="initial-content">
{{ content }}
</div>
{% if site.search == true %}
<div class="search-content">
{% include_cached search/search_form.html %}
</div>
{% endif %}
<div class="page__footer">
<footer>
{% include footer/custom.html %}
{% include_cached footer.html %}
</footer>
</div>
{% include scripts.html %}
</body>
</html>

15
_pages/404.md Normal file
View file

@ -0,0 +1,15 @@
---
title: "Page Not Found"
layout: single
sitemap: false
permalink: /404.html
---
Sorry, but the page you were trying to view does not exist --- perhaps you can try searching for it below.
<script>
var GOOG_FIXURL_LANG = 'en';
var GOOG_FIXURL_SITE = '{{ site.url }}'
</script>
<script src="https://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js">
</script>

26
_pages/privacy.md Normal file
View file

@ -0,0 +1,26 @@
---
title: "Privacy Policy"
layout: single
sitemap: false
permalink: /privacy
---
### Analytics
This site uses Google Analytics, a web analytics service offered by Google that
tracks and reports website traffic.
This service is used to better understand the kind of people who visit this
site and which content they use. This information is used to better write the
documentation for yadm.
For more information see [Google Analytics Terms of Service][ga-tos].
### Opt Out
Would you like to opt out of tracking? You can use a browser plugin to opt out
of all Google Analytics tracking. For more information see [Google Analytics
Opt-out Browser Add-on][plugin].
[ga-tos]: https://www.google.com/analytics/terms/
[plugin]: https://tools.google.com/dlpage/gaoptout/

146
_pages/splash.md Normal file
View file

@ -0,0 +1,146 @@
---
layout: splash
permalink: /
stars_button: '
{::nomarkdown}<iframe
src="https://ghbtns.com/github-btn.html?user=TheLocehiliosan&repo=yadm&type=star&count=true"
frameborder="0" scrolling="0" width="100"
height="20px" style="float: right;"></iframe>{:/nomarkdown}
'
title: Yet Another Dotfiles Manager
header:
overlay_color: "#000"
overlay_filter: 0.7
overlay_image: /images/unsplash.jpg
cta_label: Install Now
cta_url: /docs/install
caption: "_Photo: [Michael Jasmund](https://unsplash.com/photos/o51enAB_89A)_"
excerpt: '
When you live in a command line, configurations are a deeply personal thing.
They are often crafted over years of experience, battles lost, lessons learned,
advice followed, and ingenuity rewarded. When you are away from your own
configurations, you are an orphaned refugee in unfamiliar and hostile
surroundings. You feel clumsy and out of sorts. You are filled with a sense of
longing to be back in a place you know. A place you built. A place where all the
short-cuts have been worn bare by your own travels. A place you proudly call...
**$HOME**.
'
feature_row:
- title: Overview
alt: Overview
btn_class: btn--inverse
btn_label: Discover yadm
image_path: /images/picture-padding.png
url: /docs/overview
excerpt: '
If you know how to use Git, you already know how to use yadm.
yadm helps you maintain a single repository of dotfiles, while keeping
them where they belong---in `$HOME`.
Anything you can do with Git, you can do using yadm.
'
- title: Alternate Files
alt: Alternates
btn_class: btn--inverse
btn_label: Details
image_path: /images/copy-padding.png
url: /docs/alternates
excerpt: '
Sometimes you need different configurations on different systems.
yadm makes it possible to use alternate versions of files based on
the OS or hostname of the system.
Templates allow you to use alternate sections within files.
'
- title: Encryption
alt: Encryption
btn_class: btn--inverse
btn_label: Learn more
image_path: /images/secret-padding.png
url: /docs/encryption
excerpt: '
Configurations occasionally include secrets such as passwords,
encryption keys, or other sensitive information. yadm allows you to
add such files to an encrypted archive, which can be maintained
alongside your other configurations.
'
- title: Bootstrap
alt: Bootstrap
btn_class: btn--inverse
btn_label: Explore how
image_path: /images/tasks-padding.png
url: /docs/bootstrap
excerpt: '
Define your own instructions to complete your dotfiles installation.
If provided, yadm can execute your custom program immediately
following a successful clone.
'
- title: Hooks
alt: Hooks
btn_class: btn--inverse
btn_label: Get started
image_path: /images/cogs-padding.png
url: /docs/hooks
excerpt: '
Perform custom operations before or after any yadm command.
'
- title: FAQ
alt: FAQ
btn_class: btn--inverse
btn_label: Get answers
image_path: /images/question-circle-padding.png
url: /docs/faq
excerpt: '
Have a question? You might find an answer in the FAQ.
'
- title: Manual
alt: Manual
btn_class: btn--inverse
btn_label: See man page
image_path: /images/book-padding.png
url: https://github.com/TheLocehiliosan/yadm/blob/master/yadm.md
excerpt: '
View the manual online.
'
- title: Example Dotfiles
alt: Examples
btn_class: btn--inverse
btn_label: View examples
image_path: /images/keyboard-padding.png
url: /docs/examples
excerpt: '
Need some inspiration? Here are some example dotfiles repository.
'
- title: Contribute
alt: Contribute
btn_class: btn--inverse
btn_label: Read guidlines
image_path: /images/hands-padding.png
url: https://github.com/TheLocehiliosan/yadm/blob/master/.github/CONTRIBUTING.md
excerpt: '
Improve yadm by reporting bugs, coding changes, documentation and
packaging yadm installations.
'
---
{% include feature_row id="intro" type="center" %}
{% include feature_row %}

133
bootstrap
View file

@ -1,133 +0,0 @@
#!/bin/bash
#
# This script can be "curl-piped" into bash to bootstrap a dotfiles repo when
# yadm is not locally installed. Read below for instructions.
#
# This script is hosted at bootstrap.yadm.io to make it easy to remember/type.
#
# DISCLAIMER: In general, I would advise against piping someone's code directly
# from the Internet into an interpreter (like Bash). You should
# probably review any code like this prior to executing it. I leave
# it to you to decide if this is risky behavior or not. The main
# reason this script exists is because I find it to be a pragmatic
# way to bootstrap my dotfiles, and install yadm in one step
# (allowing the yadm project to be a submodule of my dotfiles
# repo).
#
# Invoke bootstrap with:
#
# curl -L bootstrap.yadm.io | bash
#
# OR
#
# curl -L bootstrap.yadm.io | bash [-s -- REPO_URL [YADM_RELEASE]]
#
# Alternatively, source in this file to export a yadm() function which uses
# yadm remotely until it is locally installed.
#
# source <(curl -L bootstrap.yadm.io)
#
YADM_REPO="https://github.com/TheLocehiliosan/yadm"
YADM_RELEASE=${release:-master}
REPO_URL=""
function _private_yadm() {
unset -f yadm
if command -v yadm &> /dev/null; then
echo "Found yadm installed locally, removing remote yadm() function"
unset -f _private_yadm
command yadm "$@"
else
function yadm() { _private_yadm "$@"; }; export -f yadm
echo WARNING: Using yadm remotely. You should install yadm locally.
curl -fsSL "$YADM_REPO/raw/$YADM_RELEASE/yadm" | bash -s -- "$@"
fi
}
export -f _private_yadm
function yadm() { _private_yadm "$@"; }; export -f yadm
# if being sourced, return here, otherwise continue processing
return 2>/dev/null
unset -f yadm
function remote_yadm() {
curl -fsSL "$YADM_REPO/raw/$YADM_RELEASE/yadm" | bash -s -- "$@"
}
function ask_about_source() {
if ! command -v yadm &> /dev/null; then
echo
echo "***************************************************"
echo "yadm is NOT currently installed."
echo "You should install it locally, this link may help:"
echo "https://yadm.io/docs/install"
echo "***************************************************"
echo
echo "If installation is not possible right now, you can temporarily \"source\""
echo "in a yadm() function which fetches yadm remotely each time it is called."
echo
echo " source <(curl -L bootstrap.yadm.io)"
echo
fi
}
function build_url() {
echo "No repo URL provided."
echo
echo "Where is your repo?"
echo
echo " 1. GitHub"
echo " 2. Bitbucket"
echo " 3. GitLab"
echo " 4. Other"
echo
read -r -p "Where is your repo? (1/2/3/4) ->" choice < /dev/tty
case $choice in
1)
REPO_URL="https://github.com/"
;;
2)
REPO_URL="https://bitbucket.org/"
;;
3)
REPO_URL="https://gitlab.com/"
;;
*)
echo
echo Please specify the full URL of your dotfiles repo
read -r -p "URL ->" choice < /dev/tty
REPO_URL="$choice"
return
;;
esac
echo
echo "Provide your user and repo separated by '/'"
echo "For example: UserName/dotfiles"
echo
read -r -p "User/Repo ->" choice < /dev/tty
[[ "$choice" =~ ^[^[:space:]]+/[^[:space:]]+$ ]] || {
echo "Not formatted as USER/REPO"
REPO_URL=
return
}
REPO_URL="${REPO_URL}${choice}.git"
}
function main() {
[ -n "$1" ] && REPO_URL="$1"
[ -n "$2" ] && YADM_RELEASE="$2"
[ -z "$REPO_URL" ] && build_url
[ -z "$REPO_URL" ] && echo "Unable to determine the repo URL" && exit 1
echo "Using URL: $REPO_URL"
remote_yadm clone "$REPO_URL"
ask_about_source
}
main "$@"

View file

@ -1,47 +0,0 @@
# Installation
### Prerequisites
Bash and Zsh completion only works if Git completions are also enabled.
## Homebrew
If using `homebrew` to install yadm, Bash, Zsh, and Fish completions should
automatically be installed. For Bash and Zsh, you also must install
`bash-completion` or `zsh-completions`. This might require you to include the
main completion script in your own shell configuration like this:
```bash
[ -f /usr/local/etc/bash_completion ] && source /usr/local/etc/bash_completion
```
## Bash (manual installation)
Copy the completion script locally, and add this to you bashrc:
```bash
[ -f /path/to/yadm/completion/bash/yadm ] && source /path/to/yadm/completion/bash/yadm
```
## Zsh (manual installation)
Add the `completion/zsh` folder to `$fpath` in `.zshrc`:
```zsh
fpath=(/path/to/yadm/completion/zsh $fpath)
autoload -U compinit
compinit
```
## Zsh (using [zplug](https://github.com/b4b4r07/zplug))
Load `_yadm` as a plugin in your `.zshrc`:
```zsh
fpath=("$ZPLUG_HOME/bin" $fpath)
zplug "TheLocehiliosan/yadm", use:"completion/zsh/_yadm", as:command, defer:2
```
## Fish (manual installation)
Copy the completion script `yadm.fish` to any folder within `$fish_complete_path`. For example, for local installation, you can copy it to `$HOME/.config/fish/completions/` and it will be loaded when `yadm` is invoked.

View file

@ -1,111 +0,0 @@
# test if git completion is missing, but loader exists, attempt to load
if ! declare -F _git > /dev/null && ! declare -F __git_wrap__git_main > /dev/null; then
if declare -F _completion_loader > /dev/null; then
_completion_loader git
fi
fi
# only operate if git completion is present
if declare -F _git > /dev/null || declare -F __git_wrap__git_main > /dev/null; then
_yadm() {
local current=${COMP_WORDS[COMP_CWORD]}
local penultimate
if [ "$((COMP_CWORD-1))" -ge "0" ]; then
penultimate=${COMP_WORDS[COMP_CWORD-1]}
fi
local antepenultimate
if [ "$((COMP_CWORD-2))" -ge "0" ]; then
antepenultimate=${COMP_WORDS[COMP_CWORD-2]}
fi
local -x GIT_DIR
# shellcheck disable=SC2034
GIT_DIR="$(yadm introspect repo 2>/dev/null)"
case "$penultimate" in
bootstrap)
COMPREPLY=()
return 0
;;
config)
COMPREPLY=( $(compgen -W "$(yadm introspect configs 2>/dev/null)") )
return 0
;;
decrypt)
COMPREPLY=( $(compgen -W "-l" -- "$current") )
return 0
;;
init)
COMPREPLY=( $(compgen -W "-f -w" -- "$current") )
return 0
;;
introspect)
COMPREPLY=( $(compgen -W "commands configs repo switches" -- "$current") )
return 0
;;
help)
COMPREPLY=() # no specific help yet
return 0
;;
list)
COMPREPLY=( $(compgen -W "-a" -- "$current") )
return 0
;;
esac
case "$antepenultimate" in
clone)
COMPREPLY=( $(compgen -W "-f -w -b --bootstrap --no-bootstrap" -- "$current") )
return 0
;;
esac
local yadm_switches=( $(yadm introspect switches 2>/dev/null) )
# this condition is so files are completed properly for --yadm-xxx options
if [[ " ${yadm_switches[*]} " != *" $penultimate "* ]]; then
# TODO: somehow solve the problem with [--yadm-xxx option] being
# incompatible with what git expects, namely [--arg=option]
if declare -F _git > /dev/null; then
_git
else
__git_wrap__git_main
fi
fi
if [[ "$current" =~ ^- ]]; then
local matching
matching=$(compgen -W "${yadm_switches[*]}" -- "$current")
__gitcompappend "$matching"
fi
# Find the index of where the sub-command argument should go.
local command_idx
for (( command_idx=1 ; command_idx < ${#COMP_WORDS[@]} ; command_idx++ )); do
local command_idx_arg="${COMP_WORDS[$command_idx]}"
if [[ " ${yadm_switches[*]} " = *" $command_idx_arg "* ]]; then
let command_idx++
elif [[ "$command_idx_arg" = -* ]]; then
:
else
break
fi
done
if [[ "$COMP_CWORD" = "$command_idx" ]]; then
local matching
matching=$(compgen -W "$(yadm introspect commands 2>/dev/null)" -- "$current")
__gitcompappend "$matching"
fi
# remove duplicates found in COMPREPLY (a native bash way could be better)
if [ -n "${COMPREPLY[*]}" ]; then
COMPREPLY=($(echo "${COMPREPLY[@]}" | sort -u))
fi
}
complete -o bashdefault -o default -F _yadm yadm 2>/dev/null \
|| complete -o default -F _yadm yadm
fi

View file

@ -1,77 +0,0 @@
#!/usr/bin/fish
function __fish_yadm_universial_optspecs
string join \n 'a-yadm-dir=' 'b-yadm-repo=' 'c-yadm-config=' \
'd-yadm-encrypt=' 'e-yadm-archive=' 'f-yadm-bootstrap='
end
function __fish_yadm_needs_command
# Figure out if the current invocation already has a command.
set -l cmd (commandline -opc)
set -e cmd[1]
argparse -s (__fish_yadm_universial_optspecs) -- $cmd 2>/dev/null
or return 0
if set -q argv[1]
echo $argv[1]
return 1
end
return 0
end
function __fish_yadm_using_command
set -l cmd (__fish_yadm_needs_command)
test -z "$cmd"
and return 1
contains -- $cmd $argv
and return 0
end
# yadm's specific autocomplete
complete -x -c yadm -n '__fish_yadm_needs_command' -a 'clone' -d 'Clone an existing repository'
complete -F -c yadm -n '__fish_yadm_using_command clone' -s w -d 'work-tree to use (default: $HOME)'
complete -f -c yadm -n '__fish_yadm_using_command clone' -s b -d 'branch to clone'
complete -x -c yadm -n '__fish_yadm_using_command clone' -s f -d 'force to overwrite'
complete -x -c yadm -n '__fish_yadm_using_command clone' -l bootstrap -d 'force bootstrap to run'
complete -x -c yadm -n '__fish_yadm_using_command clone' -l no-bootstrap -d 'prevent bootstrap from beingrun'
complete -x -c yadm -n '__fish_yadm_needs_command' -a 'alt' -d 'Create links for alternates'
complete -x -c yadm -n '__fish_yadm_needs_command' -a 'bootstrap' -d 'Execute $HOME/.config/yadm/bootstrap'
complete -x -c yadm -n '__fish_yadm_needs_command' -a 'perms' -d 'Fix perms for private files'
complete -x -c yadm -n '__fish_yadm_needs_command' -a 'enter' -d 'Run sub-shell with GIT variables set'
complete -c yadm -n '__fish_yadm_needs_command' -a 'git-crypt' -d 'Run git-crypt commands for the yadm repo'
complete -x -c yadm -n '__fish_yadm_needs_command' -a 'help' -d 'Print a summary of yadm commands'
complete -x -c yadm -n '__fish_yadm_needs_command' -a 'upgrade' -d 'Upgrade to version 2 of yadm directory structure'
complete -x -c yadm -n '__fish_yadm_needs_command' -a 'version' -d 'Print the version of yadm'
complete -x -c yadm -n '__fish_yadm_needs_command' -a 'init' -d 'Initialize an empty repository'
complete -x -c yadm -n '__fish_yadm_using_command init' -s f -d 'force to overwrite'
complete -F -c yadm -n '__fish_yadm_using_command init' -s w -d 'set work-tree (default: $HOME)'
complete -x -c yadm -n '__fish_yadm_needs_command' -a 'list' -d 'List tracked files at current directory'
complete -x -c yadm -n '__fish_yadm_using_command list' -s a -d 'list all managed files instead'
complete -x -c yadm -n '__fish_yadm_needs_command' -a 'encrypt' -d 'Encrypt files'
complete -x -c yadm -n '__fish_yadm_needs_command' -a 'decrypt' -d 'Decrypt files'
complete -x -c yadm -n '__fish_yadm_using_command decrypt' -s l -d 'list the files stored without extracting'
complete -x -c yadm -n '__fish_yadm_needs_command' -a 'introspect' -d 'Report internal yadm data'
complete -x -c yadm -n '__fish_yadm_using_command introspect' -a (printf -- '%s\n' 'commands configs repo switches') -d 'category'
complete -x -c yadm -n '__fish_yadm_needs_command' -a 'gitconfig' -d 'Pass options to the git config command'
complete -x -c yadm -n '__fish_yadm_needs_command' -a 'config' -d 'Configure a setting'
for name in (yadm introspect configs)
complete -x -c yadm -n '__fish_yadm_using_command config' -a '$name' -d 'yadm config'
end
# yadm universial options
complete --force-files -c yadm -s Y -l yadm-dir -d 'Override location of yadm directory'
complete --force-files -c yadm -l yadm-repo -d 'Override location of yadm repository'
complete --force-files -c yadm -l yadm-config -d 'Override location of yadm configuration file'
complete --force-files -c yadm -l yadm-encrypt -d 'Override location of yadm encryption configuration'
complete --force-files -c yadm -l yadm-archive -d 'Override location of yadm encrypted files archive'
complete --force-files -c yadm -l yadm-bootstrap -d 'Override location of yadm bootstrap program'
# wraps git's autocomplete
set -l GIT_DIR (yadm introspect repo)
# setup the correct git-dir by appending it to git's argunment
complete -c yadm -w "git --git-dir=$GIT_DIR"

View file

@ -1,180 +0,0 @@
#compdef yadm
# This completion tries to fallback to git's completion for git commands.
zstyle -T ':completion:*:yadm:argument-1:descriptions:' format && \
zstyle ':completion:*:yadm:argument-1:descriptions' format '%d:'
zstyle -T ':completion:*:yadm:*:yadm' group-name && \
zstyle ':completion:*:yadm:*:yadm' group-name ''
function _yadm-add(){
local -a yadm_options yadm_path
yadm_path="$(yadm rev-parse --show-toplevel)"
yadm_options=($(yadm status --porcelain=v1 |
awk -v yadm_path=${yadm_path} '{printf "%s/%s:%s\n", yadm_path, $2, $1}' ))
_describe 'command' yadm_options
_files
}
function _yadm-checkout(){
_yadm-add
}
_yadm-alt() {
return 0
}
_yadm-bootstrap() {
return 0
}
_yadm-clone() {
_arguments \
'(--bootstrap --no-bootstrap)--bootstrap[force bootstrap, without prompt]' \
'(--bootstrap --no-bootstrap)--no-bootstrap[prevent bootstrap, without prompt]' \
'-f[force overwrite of existing repository]' \
'-w[yadm work tree path]: :_files -/'
local curcontext="${curcontext%:*:*}:git:"
words=("git" "${words[@]}") CURRENT=$((CURRENT + 1)) service=git _git
}
_yadm-config() {
# TODO: complete config names
}
_yadm-decrypt() {
_arguments \
'-l[list files]'
}
_yadm-encrypt() {
return 0
}
_yadm-enter() {
_arguments \
':command: _command_names -e' \
'*::arguments: _normal'
}
_yadm-git-crypt() {
# TODO: complete git-crypt options
}
_yadm-help() {
return 0
}
_yadm-init() {
_arguments \
'-f[force overwrite of existing repository]' \
'-w[work tree path]: :_files -/'
}
_yadm-list() {
_arguments \
'-a[list all tracked files]'
}
_yadm-perms() {
return 0
}
_yadm-transcrypt() {
integer _ret=1
_call_function _ret _transcrypt
return _ret
}
_yadm-upgrade() {
_arguments \
'-f[force deinit of submodules]' \
': '
}
_yadm-version() {
return 0
}
_yadm_commands() {
local -a commands=(
alt:'create links for alternates'
bootstrap:'execute bootstrap'
clone:'clone an existing yadm repository'
config:'configure an yadm setting'
decrypt:'decrypt files'
encrypt:'encrypt files'
enter:'run sub-shell with GIT variables set'
git-crypt:'run git-crypt commands for the yadm repository'
gitconfig:'run the git config command'
help:'display yadm help information'
init:'initialize an empty yadm repository'
list:'list files tracked by yadm'
perms:'fix perms for private files'
transcrypt:'run transcrypt commands for the yadm repository'
upgrade:'upgrade legacy yadm paths'
version:'show yadm version'
)
local oldcontext="$curcontext"
local curcontext="${curcontext%:*:*}:git:"
words=("git" "${words[-1]}") CURRENT=2 service=git _git
curcontext="$oldcontext"
_describe -t yadm "yadm commands" commands
return 0
}
_yadm() {
local curcontext=$curcontext state state_descr line
declare -A opt_args
_arguments -C \
'(-Y --yadm-dir)'{-Y,--yadm-dir}'[override the standard yadm directory]: :_files -/' \
'--yadm-data[override the standard yadm data directory]: :_files -/' \
'--yadm-repo[override the standard repo path]: :_files -/' \
'--yadm-config[override the standard config path]: :_files -/' \
'--yadm-encrypt[override the standard encrypt path]: :_files -/' \
'--yadm-archive[override the standard archive path]: :_files -/' \
'--yadm-bootstrap[override the standard bootstrap path]: :_files' \
'--help[display yadm help information]' \
'--version[show yadm version]' \
'(-): :->command' \
'(-)*:: :->option-or-argument' && return
local -a repo_args
(( $+opt_args[--yadm-repo] )) && repo_args+=(--yadm-repo "$opt_args[--yadm-repo]")
(( $+opt_args[--yadm-data] )) && repo_args+=(--yadm-data "$opt_args[--yadm-data]")
local -x GIT_DIR="$(_call_program gitdir yadm "${repo_args[@]}" introspect repo)"
[[ -z "$GIT_DIR" ]] && return 1
integer _ret=1
case $state in
(command)
_yadm_commands && _ret=0
;;
(option-or-argument)
curcontext=${curcontext%:*:*}:yadm-${words[1]}:
if ! _call_function _ret _yadm-${words[1]}; then
# Translate gitconfig to use the regular completion for config
[[ ${words[1]} = "gitconfig" ]] && words[1]=config
words=("git" "${(@)words}")
CURRENT=$(( CURRENT + 1 ))
curcontext=${curcontext%:*:*}:git:
service=git _git && _ret=0
fi
;;
esac
return _ret
}
(( $+functions[_git] )) && _yadm

View file

@ -1,24 +0,0 @@
#!/bin/bash
# Save this file as ~/.config/yadm/bootstrap and make it executable. It will
# execute all executable files (excluding templates and editor backups) in the
# ~/.config/yadm/bootstrap.d directory when run.
set -eu
# Directory to look for bootstrap executables in
BOOTSTRAP_D="${BASH_SOURCE[0]}.d"
if [[ ! -d "$BOOTSTRAP_D" ]]; then
echo "Error: bootstrap directory '$BOOTSTRAP_D' not found" >&2
exit 1
fi
find -L "$BOOTSTRAP_D" -type f | sort | while IFS= read -r bootstrap; do
if [[ -x "$bootstrap" && ! "$bootstrap" =~ "##" && ! "$bootstrap" =~ "~$" ]]; then
if ! "$bootstrap"; then
echo "Error: bootstrap '$bootstrap' failed" >&2
exit 1
fi
fi
done

View file

@ -1,9 +0,0 @@
## Contributed Commands
Although these commands are available as part of the official
**yadm** source tree, they have a somewhat different status. The intention is to
keep interesting and potentially useful commands here, building a library of
examples that might help others.
I recommend *careful review* of any code from here before using it. No
guarantees of code quality is assumed.

View file

@ -1,71 +0,0 @@
#!/usr/bin/env bash
# To run: `yadm-untracked <config-file>`
#
# If you wish to create a YADM alias to run this as, for example `yadm untracked`
# then the following command will add the alias:
# `yadm gitconfig alias.untracked '!<PATH>/yadm-untracked'`
# Possible script improvements:
# - Reduce the amount of configuration; I have not figured out a way to
# get rid of the non-recursive and ignore. The recursive list could be
# built from the directories that are present in `yadm list`
# Configuration... The script looks at the following 3 arrays:
#
# yadm_tracked_recursively
# The directories and files in this list are searched recursively to build
# a list of files that you expect are tracked with `yadm`. Items in this
# list are relative to the root of your YADM repo (which is $HOME for most).
# yadm_tracked_nonrecursively
# Same as above but don't search recursively
#
# ignore_files_and_dirs
# A list of directories and files that will not be reported as untracked if
# found in the above two searches.
#
# Example configuration file (uncomment it to use):
# yadm_tracked_recursively=(
# bin .config .vim
# )
#
# yadm_tracked_nonrecursively=(
# ~
# )
#
# ignore_files_and_dirs=(
# .CFUserTextEncoding .DS_Store .config/gh
# .vim/autoload/plug.vim
# )
if [[ $# -ne 1 ]]; then
echo 'Usage: yadm-untracked <config-file>'
exit 1
fi
yadm_tracked_recursively=()
yadm_tracked_nonrecursively=()
ignore_files_and_dirs=()
source $1
root=`yadm enter echo '$GIT_WORK_TREE'`
cd $root
find_list=$(mktemp -t find_list)
find ${yadm_tracked_recursively[*]} -type f >$find_list
find ${yadm_tracked_nonrecursively[*]} -maxdepth 1 -type f |
awk "{sub(\"^\./\", \"\"); sub(\"^$root/\", \"\"); print }" >>$find_list
sort -o $find_list $find_list
yadm_list=$(mktemp -t yadm_list)
yadm list >$yadm_list
find ${ignore_files_and_dirs[*]} -type f >>$yadm_list
sort -o $yadm_list $yadm_list
# Show the files not in `yadm list`
comm -23 $find_list $yadm_list
rm -f $find_list $yadm_list

View file

@ -1,14 +0,0 @@
## Contributed Hooks
Although these [hooks][hooks-help] are available as part of the official
**yadm** source tree, they have a somewhat different status. The intention is to
keep interesting and potentially useful hooks here, building a library of
examples that might help others.
In some cases, an experimental new feature can be build entirely with hooks, and
this is a place to share it.
I recommend *careful review* of any code from here before using it. No
guarantees of code quality is assumed.
[hooks-help]: https://github.com/TheLocehiliosan/yadm/blob/master/yadm.md#hooks

View file

@ -1,9 +0,0 @@
## Track checksums of encrypted files
Contributed by Martin Zuther
Hook | Description
---- | -----------
post_encrypt | Collects the checksums of encrypted files, and stores them in .config/yadm/files.checksums
post_list | Prints the names of encrypted files
post_status | Reports untracked changes within encrypted files

View file

@ -1,96 +0,0 @@
#!/usr/bin/env bash
# yadm - Yet Another Dotfiles Manager
# Copyright (C) 2015-2021 Tim Byrne and Martin Zuther
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
YADM_CHECKSUMS="$YADM_HOOK_DIR/files.checksums"
WARNING_MESSAGE="No checksums were created"
# unpack exported array; filenames including a newline character (\n)
# are NOT supported
OLD_IFS="$IFS"
IFS=$'\n'
YADM_ENCRYPT_INCLUDE_FILES=( $YADM_ENCRYPT_INCLUDE_FILES )
IFS="$OLD_IFS"
function get_checksum_command {
# check if "shasum" exists and supports the algorithm (which is
# tested by sending an empty string to "shasum")
if command -v "shasum" > /dev/null && printf "" | shasum --algorithm "256" &> /dev/null; then
printf "shasum --algorithm 256"
# check if "sha256sum" exists
elif command -v "sha256sum" > /dev/null; then
printf "sha256sum"
# check if "gsha256sum" exists
elif command -v "gsha256sum" > /dev/null; then
printf "gsha256sum"
else
# display warning in bright yellow
printf "\033[1;33m" >&2
printf "\nWARNING: \"shasum\", \"sha256sum\" and \"gsha256sum\" not found. %s\n" "$WARNING_MESSAGE." >&2
# reset output color
printf "\033[0m" >&2
# signal error
return 1
fi
}
# get checksum command
CHECKSUM_COMMAND=$(get_checksum_command)
# no command found
if (($?)); then
# return original exit status of yadm command
exit "$YADM_HOOK_EXIT"
fi
# empty (or create) checksum file
true > "$YADM_CHECKSUMS"
# calculate checksums for encrypted files
for included in "${YADM_ENCRYPT_INCLUDE_FILES[@]}"; do
# highlight any errors in red
printf "\033[0;31m"
# calculate checksums
$CHECKSUM_COMMAND "$included" >> "$YADM_CHECKSUMS"
ERROR_CODE=$?
# reset output color
printf "\033[0m"
# handle errors
if (($ERROR_CODE)); then
# display warning in bright yellow
printf "\033[1;33m" >&2
printf "\nWARNING: an error occurred. Please inspect the checksum file.\n" >&2
# reset output color
printf "\033[0m" >&2
# exit and signal error
exit $ERROR_CODE
fi
done
# announce success and return original exit status of yadm command
printf "Wrote SHA-256 checksums: %s\n" "$YADM_CHECKSUMS"
exit "$YADM_HOOK_EXIT"

View file

@ -1,69 +0,0 @@
#!/usr/bin/env bash
# yadm - Yet Another Dotfiles Manager
# Copyright (C) 2015-2021 Tim Byrne and Martin Zuther
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
YADM_CHECKSUMS="$YADM_HOOK_DIR/files.checksums"
# is current directory on yadm's work path?
# (adapted from https://unix.stackexchange.com/a/6438/122163)
if [ "${PWD##$YADM_HOOK_WORK}" != "$PWD" ]; then
ON_WORK_PATH=1
else
ON_WORK_PATH=0
fi
# list all files or only those in the subdirectories below?
OPTION_LIST_ALL=0
for argument in "${YADM_HOOK_FULL_COMMAND[@]}"; do
# mimick git ls-files by displaying all files when not on work
# path
if [ "$argument" = "-a" ] || [ $ON_WORK_PATH -eq 0 ]; then
OPTION_LIST_ALL=1
break
fi
done
# if there is no checksum file, exit with original status of yadm
# command
if [ ! -f "$YADM_CHECKSUMS" ]; then
exit "$YADM_HOOK_EXIT"
fi
# list encrypted files
while IFS= read -r filename; do
# remove checksums from file names
filename="${filename##[a-zA-Z0-9]* }"
# list only files in the subdirectories below (i.e. files
# whose relative path doesn't begin with "../")
if [ $OPTION_LIST_ALL -eq 0 ]; then
REL_PATH=$(relative_path "$PWD" "$YADM_HOOK_WORK/$filename")
if [ "$REL_PATH" = "${REL_PATH##../}" ]; then
printf "%s\n" "$REL_PATH"
fi
# list all files
else
printf "%s\n" "$filename"
fi
done < "$YADM_CHECKSUMS"
# return original exit status of yadm command
exit "$YADM_HOOK_EXIT"

View file

@ -1,100 +0,0 @@
#!/usr/bin/env bash
# yadm - Yet Another Dotfiles Manager
# Copyright (C) 2015-2021 Tim Byrne and Martin Zuther
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
YADM_CHECKSUMS="$YADM_HOOK_DIR/files.checksums"
WARNING_MESSAGE="Checksums were not verified"
# unpack exported array; filenames including a newline character (\n)
# are NOT supported
OLD_IFS="$IFS"
IFS=$'\n'
YADM_ENCRYPT_INCLUDE_FILES=( $YADM_ENCRYPT_INCLUDE_FILES )
IFS="$OLD_IFS"
function get_checksum_command {
# check if "shasum" exists and supports the algorithm (which is
# tested by sending an empty string to "shasum")
if command -v "shasum" > /dev/null && printf "" | shasum --algorithm "256" &> /dev/null; then
printf "shasum --algorithm 256"
# check if "sha256sum" exists
elif command -v "sha256sum" > /dev/null; then
printf "sha256sum"
# check if "gsha256sum" exists
elif command -v "gsha256sum" > /dev/null; then
printf "gsha256sum"
else
# display warning in bright yellow
printf "\033[1;33m" >&2
printf "\nWARNING: \"shasum\", \"sha256sum\" and \"gsha256sum\" not found. %s\n" "$WARNING_MESSAGE." >&2
# reset output color
printf "\033[0m" >&2
# signal error
return 1
fi
}
# if there is no checksum file, exit with original status of yadm
# command
if [ ! -f "$YADM_CHECKSUMS" ]; then
exit "$YADM_HOOK_EXIT"
fi
# get checksum command
CHECKSUM_COMMAND=$(get_checksum_command)
# no command found
if (($?)); then
# return original exit status of yadm command
exit "$YADM_HOOK_EXIT"
fi
# check encrypted files for differences and capture output and error
# messages
YADM_CHECKSUM_OUTPUT=$($CHECKSUM_COMMAND --check "$YADM_CHECKSUMS" 2>&1)
ERROR_CODE=$?
# handle mismatched checksums and errors
if (($ERROR_CODE)); then
printf "\nSome SHA-256 sums do not match (or an error occurred):\n\n"
# display differing files and errors (highlighted in red)
printf "\033[0;31m"
while IFS= read -r line; do
# beautify output and get rid of unnecessary lines
line="${line%%*: [Oo][Kk]}"
line="${line%%: [Ff][Aa][Ii][Ll][Ee][Dd]}"
line="${line##*WARNING:*did NOT match}"
if [ -n "$line" ]; then
printf "%s\n" "$line"
fi
done <<< "$YADM_CHECKSUM_OUTPUT"
# reset output color
printf "\033[0m"
# display advice for differing files and signal error
printf "\nConsider running either \"yadm encrypt\" or \"yadm decrypt\".\n"
exit $ERROR_CODE
fi

View file

@ -1,7 +0,0 @@
## Example of parsing `$YADM_HOOK_FULL_COMMAND`
Contributed by Tim Byrne
Hook | Description
---- | -----------
pre_log | Provides an example of parsing `$YADM_HOOK_FULL_COMMAND` in Bash

View file

@ -1,26 +0,0 @@
#!/bin/bash
# yadm exposes all parameters of the command which triggers a hook. Those
# parameters are exported as the environment variable YADM_HOOK_FULL_COMMAND.
# Any spaces, tabs, or backslashes in those parameters are escaped with a
# backslash. The function `parse_full_command()` is a demonstration of parsing
# those values which may be escaped.
function parse_full_command() {
local delim=$'\x1e' # ASCII Record Separator
local space=$'\x1f' # ASCII Unit Separator
local tab=$'\t' # ASCII TAB
local cmd
cmd="$YADM_HOOK_FULL_COMMAND"
cmd="${cmd//\\ /$space}" # swap escaped spaces for `1f`
cmd="${cmd//\\\\/\\}" # fix escaped backslashes
cmd="${cmd//\\$tab/$tab}" # fix escaped tabs
cmd="${cmd// /$delim}" # convert space delimiters to `1c`
cmd="${cmd//$space/ }" # convert `1f` back to spaces
# parse data into an array
IFS=$delim read -r -a full_cmd <<< "$cmd"
}
parse_full_command
for param in "${full_cmd[@]}"; do
echo "Parameter: '$param'"
done

13
docker-compose.yml Normal file
View file

@ -0,0 +1,13 @@
---
version: '3'
services:
website:
image: yadm/jekyll:2019-10-17
ports:
- 4000:4000
volumes:
- .:/srv/jekyll
- jekyll-bundle:/usr/local/bundle
command: jekyll serve --config _config.yml,_dev.yml -t --watch --incremental
volumes:
jekyll-bundle:

BIN
images/bio-photo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
images/book-padding.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

BIN
images/book.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

2
images/book.svg Normal file
View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1703 478q40 57 18 129l-275 906q-19 64-76.5 107.5t-122.5 43.5h-923q-77 0-148.5-53.5t-99.5-131.5q-24-67-2-127 0-4 3-27t4-37q1-8-3-21.5t-3-19.5q2-11 8-21t16.5-23.5 16.5-23.5q23-38 45-91.5t30-91.5q3-10 .5-30t-.5-28q3-11 17-28t17-23q21-36 42-92t25-90q1-9-2.5-32t.5-28q4-13 22-30.5t22-22.5q19-26 42.5-84.5t27.5-96.5q1-8-3-25.5t-2-26.5q2-8 9-18t18-23 17-21q8-12 16.5-30.5t15-35 16-36 19.5-32 26.5-23.5 36-11.5 47.5 5.5l-1 3q38-9 51-9h761q74 0 114 56t18 130l-274 906q-36 119-71.5 153.5t-128.5 34.5h-869q-27 0-38 15-11 16-1 43 24 70 144 70h923q29 0 56-15.5t35-41.5l300-987q7-22 5-57 38 15 59 43zm-1064 2q-4 13 2 22.5t20 9.5h608q13 0 25.5-9.5t16.5-22.5l21-64q4-13-2-22.5t-20-9.5h-608q-13 0-25.5 9.5t-16.5 22.5zm-83 256q-4 13 2 22.5t20 9.5h608q13 0 25.5-9.5t16.5-22.5l21-64q4-13-2-22.5t-20-9.5h-608q-13 0-25.5 9.5t-16.5 22.5z"/></svg>

After

Width:  |  Height:  |  Size: 937 B

BIN
images/clock-padding.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
images/clock.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

2
images/clock.svg Normal file
View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1024 544v448q0 14-9 23t-23 9h-320q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h224v-352q0-14 9-23t23-9h64q14 0 23 9t9 23zm416 352q0-148-73-273t-198-198-273-73-273 73-198 198-73 273 73 273 198 198 273 73 273-73 198-198 73-273zm224 0q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z"/></svg>

After

Width:  |  Height:  |  Size: 481 B

BIN
images/clone-padding.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
images/clone.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

2
images/clone.svg Normal file
View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1664 1632v-1088q0-13-9.5-22.5t-22.5-9.5h-1088q-13 0-22.5 9.5t-9.5 22.5v1088q0 13 9.5 22.5t22.5 9.5h1088q13 0 22.5-9.5t9.5-22.5zm128-1088v1088q0 66-47 113t-113 47h-1088q-66 0-113-47t-47-113v-1088q0-66 47-113t113-47h1088q66 0 113 47t47 113zm-384-384v160h-128v-160q0-13-9.5-22.5t-22.5-9.5h-1088q-13 0-22.5 9.5t-9.5 22.5v1088q0 13 9.5 22.5t22.5 9.5h160v128h-160q-66 0-113-47t-47-113v-1088q0-66 47-113t113-47h1088q66 0 113 47t47 113z"/></svg>

After

Width:  |  Height:  |  Size: 551 B

BIN
images/cogs-padding.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
images/cogs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

2
images/cogs.svg Normal file
View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 2048 1792" xmlns="http://www.w3.org/2000/svg"><path d="M960 896q0-106-75-181t-181-75-181 75-75 181 75 181 181 75 181-75 75-181zm768 512q0-52-38-90t-90-38-90 38-38 90q0 53 37.5 90.5t90.5 37.5 90.5-37.5 37.5-90.5zm0-1024q0-52-38-90t-90-38-90 38-38 90q0 53 37.5 90.5t90.5 37.5 90.5-37.5 37.5-90.5zm-384 421v185q0 10-7 19.5t-16 10.5l-155 24q-11 35-32 76 34 48 90 115 7 11 7 20 0 12-7 19-23 30-82.5 89.5t-78.5 59.5q-11 0-21-7l-115-90q-37 19-77 31-11 108-23 155-7 24-30 24h-186q-11 0-20-7.5t-10-17.5l-23-153q-34-10-75-31l-118 89q-7 7-20 7-11 0-21-8-144-133-144-160 0-9 7-19 10-14 41-53t47-61q-23-44-35-82l-152-24q-10-1-17-9.5t-7-19.5v-185q0-10 7-19.5t16-10.5l155-24q11-35 32-76-34-48-90-115-7-11-7-20 0-12 7-20 22-30 82-89t79-59q11 0 21 7l115 90q34-18 77-32 11-108 23-154 7-24 30-24h186q11 0 20 7.5t10 17.5l23 153q34 10 75 31l118-89q8-7 20-7 11 0 21 8 144 133 144 160 0 8-7 19-12 16-42 54t-45 60q23 48 34 82l152 23q10 2 17 10.5t7 19.5zm640 533v140q0 16-149 31-12 27-30 52 51 113 51 138 0 4-4 7-122 71-124 71-8 0-46-47t-52-68q-20 2-30 2t-30-2q-14 21-52 68t-46 47q-2 0-124-71-4-3-4-7 0-25 51-138-18-25-30-52-149-15-149-31v-140q0-16 149-31 13-29 30-52-51-113-51-138 0-4 4-7 4-2 35-20t59-34 30-16q8 0 46 46.5t52 67.5q20-2 30-2t30 2q51-71 92-112l6-2q4 0 124 70 4 3 4 7 0 25-51 138 17 23 30 52 149 15 149 31zm0-1024v140q0 16-149 31-12 27-30 52 51 113 51 138 0 4-4 7-122 71-124 71-8 0-46-47t-52-68q-20 2-30 2t-30-2q-14 21-52 68t-46 47q-2 0-124-71-4-3-4-7 0-25 51-138-18-25-30-52-149-15-149-31v-140q0-16 149-31 13-29 30-52-51-113-51-138 0-4 4-7 4-2 35-20t59-34 30-16q8 0 46 46.5t52 67.5q20-2 30-2t30 2q51-71 92-112l6-2q4 0 124 70 4 3 4 7 0 25-51 138 17 23 30 52 149 15 149 31z"/></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
images/copy-padding.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
images/copy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

2
images/copy.svg Normal file
View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1696 384q40 0 68 28t28 68v1216q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-288h-544q-40 0-68-28t-28-68v-672q0-40 20-88t48-76l408-408q28-28 76-48t88-20h416q40 0 68 28t28 68v328q68-40 128-40h416zm-544 213l-299 299h299v-299zm-640-384l-299 299h299v-299zm196 647l316-316v-416h-384v416q0 40-28 68t-68 28h-416v640h512v-256q0-40 20-88t48-76zm956 804v-1152h-384v416q0 40-28 68t-68 28h-416v640h896z"/></svg>

After

Width:  |  Height:  |  Size: 510 B

BIN
images/download-padding.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

BIN
images/download.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

2
images/download.svg Normal file
View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1344 1344q0-26-19-45t-45-19-45 19-19 45 19 45 45 19 45-19 19-45zm256 0q0-26-19-45t-45-19-45 19-19 45 19 45 45 19 45-19 19-45zm128-224v320q0 40-28 68t-68 28h-1472q-40 0-68-28t-28-68v-320q0-40 28-68t68-28h465l135 136q58 56 136 56t136-56l136-136h464q40 0 68 28t28 68zm-325-569q17 41-14 70l-448 448q-18 19-45 19t-45-19l-448-448q-31-29-14-70 17-39 59-39h256v-448q0-26 19-45t45-19h256q26 0 45 19t19 45v448h256q42 0 59 39z"/></svg>

After

Width:  |  Height:  |  Size: 538 B

BIN
images/git-padding.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
images/git.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

2
images/git.svg Normal file
View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M595 1514q0-100-165-100-158 0-158 104 0 101 172 101 151 0 151-105zm-59-755q0-61-30-102t-89-41q-124 0-124 145 0 135 124 135 119 0 119-137zm269-324v202q-36 12-79 22 16 43 16 84 0 127-73 216.5t-197 112.5q-40 8-59.5 27t-19.5 58q0 31 22.5 51.5t58 32 78.5 22 86 25.5 78.5 37.5 58 64 22.5 98.5q0 304-363 304-69 0-130-12.5t-116-41-87.5-82-32.5-127.5q0-165 182-225v-4q-67-41-67-126 0-109 63-137v-4q-72-24-119.5-108.5t-47.5-165.5q0-139 95-231.5t235-92.5q96 0 178 47 98 0 218-47zm318 881h-222q4-45 4-134v-609q0-94-4-128h222q-4 33-4 124v613q0 89 4 134zm601-222v196q-71 39-174 39-62 0-107-20t-70-50-39.5-78-18.5-92-4-103v-351h2v-4q-7 0-19-1t-18-1q-21 0-59 6v-190h96v-76q0-54-6-89h227q-6 41-6 165h171v190q-15 0-43.5-2t-42.5-2h-85v365q0 131 87 131 61 0 109-33zm-576-947q0 58-39 101.5t-96 43.5q-58 0-98-43.5t-40-101.5q0-59 39.5-103t98.5-44q58 0 96.5 44.5t38.5 102.5z"/></svg>

After

Width:  |  Height:  |  Size: 972 B

BIN
images/hands-padding.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
images/hands.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

1
images/hands.svg Normal file
View file

@ -0,0 +1 @@
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="hands-helping" class="svg-inline--fa fa-hands-helping fa-w-20" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path fill="currentColor" d="M488 192H336v56c0 39.7-32.3 72-72 72s-72-32.3-72-72V126.4l-64.9 39C107.8 176.9 96 197.8 96 220.2v47.3l-80 46.2C.7 322.5-4.6 342.1 4.3 357.4l80 138.6c8.8 15.3 28.4 20.5 43.7 11.7L231.4 448H368c35.3 0 64-28.7 64-64h16c17.7 0 32-14.3 32-32v-64h8c13.3 0 24-10.7 24-24v-48c0-13.3-10.7-24-24-24zm147.7-37.4L555.7 16C546.9.7 527.3-4.5 512 4.3L408.6 64H306.4c-12 0-23.7 3.4-33.9 9.7L239 94.6c-9.4 5.8-15 16.1-15 27.1V248c0 22.1 17.9 40 40 40s40-17.9 40-40v-88h184c30.9 0 56 25.1 56 56v28.5l80-46.2c15.3-8.9 20.5-28.4 11.7-43.7z"></path></svg>

After

Width:  |  Height:  |  Size: 765 B

BIN
images/home-padding.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

BIN
images/home.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

2
images/home.svg Normal file
View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1472 992v480q0 26-19 45t-45 19h-384v-384h-256v384h-384q-26 0-45-19t-19-45v-480q0-1 .5-3t.5-3l575-474 575 474q1 2 1 6zm223-69l-62 74q-8 9-21 11h-3q-13 0-21-7l-692-577-692 577q-12 8-24 7-13-2-21-11l-62-74q-8-10-7-23.5t11-21.5l719-599q32-26 76-26t76 26l244 204v-195q0-14 9-23t23-9h192q14 0 23 9t9 23v408l219 182q10 8 11 21.5t-7 23.5z"/></svg>

After

Width:  |  Height:  |  Size: 453 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

BIN
images/info-circle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

2
images/info-circle.svg Normal file
View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1152 1376v-160q0-14-9-23t-23-9h-96v-512q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v160q0 14 9 23t23 9h96v320h-96q-14 0-23 9t-9 23v160q0 14 9 23t23 9h448q14 0 23-9t9-23zm-128-896v-160q0-14-9-23t-23-9h-192q-14 0-23 9t-9 23v160q0 14 9 23t23 9h192q14 0 23-9t9-23zm640 416q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z"/></svg>

After

Width:  |  Height:  |  Size: 521 B

BIN
images/info-padding.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
images/info.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

2
images/info.svg Normal file
View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1216 1344v128q0 26-19 45t-45 19h-512q-26 0-45-19t-19-45v-128q0-26 19-45t45-19h64v-384h-64q-26 0-45-19t-19-45v-128q0-26 19-45t45-19h384q26 0 45 19t19 45v576h64q26 0 45 19t19 45zm-128-1152v192q0 26-19 45t-45 19h-256q-26 0-45-19t-19-45v-192q0-26 19-45t45-19h256q26 0 45 19t19 45z"/></svg>

After

Width:  |  Height:  |  Size: 399 B

BIN
images/keyboard-padding.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
images/keyboard.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

2
images/keyboard.svg Normal file
View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 2048 1792" xmlns="http://www.w3.org/2000/svg"><path d="M448 1168v96q0 16-16 16h-96q-16 0-16-16v-96q0-16 16-16h96q16 0 16 16zm128-256v96q0 16-16 16h-224q-16 0-16-16v-96q0-16 16-16h224q16 0 16 16zm-128-256v96q0 16-16 16h-96q-16 0-16-16v-96q0-16 16-16h96q16 0 16 16zm1024 512v96q0 16-16 16h-864q-16 0-16-16v-96q0-16 16-16h864q16 0 16 16zm-640-256v96q0 16-16 16h-96q-16 0-16-16v-96q0-16 16-16h96q16 0 16 16zm-128-256v96q0 16-16 16h-96q-16 0-16-16v-96q0-16 16-16h96q16 0 16 16zm384 256v96q0 16-16 16h-96q-16 0-16-16v-96q0-16 16-16h96q16 0 16 16zm-128-256v96q0 16-16 16h-96q-16 0-16-16v-96q0-16 16-16h96q16 0 16 16zm384 256v96q0 16-16 16h-96q-16 0-16-16v-96q0-16 16-16h96q16 0 16 16zm384 256v96q0 16-16 16h-96q-16 0-16-16v-96q0-16 16-16h96q16 0 16 16zm-512-512v96q0 16-16 16h-96q-16 0-16-16v-96q0-16 16-16h96q16 0 16 16zm256 0v96q0 16-16 16h-96q-16 0-16-16v-96q0-16 16-16h96q16 0 16 16zm256 0v352q0 16-16 16h-224q-16 0-16-16v-96q0-16 16-16h112v-240q0-16 16-16h96q16 0 16 16zm128 752v-896h-1664v896h1664zm128-896v896q0 53-37.5 90.5t-90.5 37.5h-1664q-53 0-90.5-37.5t-37.5-90.5v-896q0-53 37.5-90.5t90.5-37.5h1664q53 0 90.5 37.5t37.5 90.5z"/></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
images/layers-padding.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
images/layers.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Some files were not shown because too many files have changed in this diff Show more