Compare commits
5 commits
bab39c5aa1
...
dc94081554
Author | SHA1 | Date | |
---|---|---|---|
|
dc94081554 | ||
|
ec10041024 | ||
|
3a1b236147 | ||
|
aba434274e | ||
|
12c51e130b |
4 changed files with 52 additions and 12 deletions
16
README.md
16
README.md
|
@ -18,11 +18,12 @@
|
|||
**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
|
||||
* Supports system-specific [alternative][feature-alternates] files or
|
||||
[templated][feature-templates] files
|
||||
* [Encryption][feature-encryption] of private data using [GnuPG][],
|
||||
[OpenSSL][], [transcrypt][], or [git-crypt][]
|
||||
* Customizable initialization ([bootstrapping][feature-bootstrap])
|
||||
* Customizable [hooks][feature-hooks] for before and after any operation
|
||||
|
||||
Complete features, usage, examples and installation instructions can be found on
|
||||
the [yadm.io][website-link] website.
|
||||
|
@ -63,6 +64,11 @@ The star count helps others discover yadm.
|
|||
[develop-commits]: https://github.com/yadm-dev/yadm/commits/develop
|
||||
[develop-date]: https://img.shields.io/github/last-commit/yadm-dev/yadm/develop.svg?label=develop
|
||||
[dotfiles]: https://en.wikipedia.org/wiki/Hidden_file_and_hidden_directory
|
||||
[feature-alternates]: https://yadm.io/docs/alternates
|
||||
[feature-bootstrap]: https://yadm.io/docs/bootstrap
|
||||
[feature-hooks]: https://yadm.io/docs/hooks
|
||||
[feature-encryption]: https://yadm.io/docs/encryption
|
||||
[feature-templates]: https://yadm.io/docs/templates
|
||||
[gh-pages-badge]: https://img.shields.io/github/actions/workflow/status/yadm-dev/yadm/test.yml?branch=gh-pages
|
||||
[git-crypt]: https://github.com/AGWA/git-crypt
|
||||
[homebrew-badge]: https://img.shields.io/homebrew/v/yadm.svg
|
||||
|
|
|
@ -14,11 +14,16 @@ if [[ ! -d "$BOOTSTRAP_D" ]]; then
|
|||
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
|
||||
declare -a bootstraps
|
||||
while IFS= read -r bootstrap; do
|
||||
if [[ -x "$bootstrap" && ! "$bootstrap" =~ "##" && ! "$bootstrap" =~ ~$ ]]; then
|
||||
bootstraps+=("$bootstrap")
|
||||
fi
|
||||
done < <(find -L "$BOOTSTRAP_D" -type f | sort)
|
||||
|
||||
for bootstrap in "${bootstraps[@]}"; do
|
||||
if ! "$bootstrap"; then
|
||||
echo "Error: bootstrap '$bootstrap' failed" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
|
|
@ -326,3 +326,32 @@ def test_no_repo(
|
|||
def verify_head(paths, branch):
|
||||
"""Assert the local repo has the correct head branch"""
|
||||
assert paths.repo.join("HEAD").read() == f"ref: refs/heads/{branch}\n"
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("remote")
|
||||
def test_clone_subdirectory(runner, paths, yadm_cmd, repo_config):
|
||||
"""Test clone from sub-directory of YADM_WORK"""
|
||||
|
||||
# clear out the work path
|
||||
paths.work.remove()
|
||||
paths.work.mkdir()
|
||||
|
||||
# create sub-directory
|
||||
subdir = paths.work.mkdir("subdir")
|
||||
|
||||
# determine remote url
|
||||
remote_url = f"file://{paths.remote}"
|
||||
|
||||
# run the clone command
|
||||
args = ["clone", "-w", paths.work]
|
||||
args += [remote_url]
|
||||
run = runner(command=yadm_cmd(*args), cwd=subdir)
|
||||
|
||||
# clone should succeed, and repo should be configured properly
|
||||
assert successful_clone(run, paths, repo_config)
|
||||
|
||||
# test that the conflicts are preserved in the work tree
|
||||
run = runner(command=yadm_cmd("status", "-uno", "--porcelain"), cwd=subdir)
|
||||
assert run.success
|
||||
assert run.out == ""
|
||||
assert run.err == ""
|
||||
|
|
2
yadm
2
yadm
|
@ -853,7 +853,7 @@ function clone() {
|
|||
rm -rf "$wc"
|
||||
|
||||
# then reset the index as the --no-checkout flag makes the index empty
|
||||
"$GIT_PROGRAM" reset --quiet -- .
|
||||
"$GIT_PROGRAM" reset --quiet -- "$YADM_WORK"
|
||||
|
||||
if [ "$YADM_WORK" = "$HOME" ]; then
|
||||
debug "Determining if repo tracks private directories"
|
||||
|
|
Loading…
Reference in a new issue