Skip to content

Commit f32b923

Browse files
committed
dot: Implement dotbot
1 parent 0fe6f4a commit f32b923

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

.dotbot

Submodule .dotbot added at b04a3f1

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule ".dotbot"]
2+
path = .dotbot
3+
url = https://github.com/anishathalye/dotbot

.install.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- defaults:
2+
link:
3+
create: true
4+
relink: true
5+
6+
- link:
7+
~/.gitconfig: git/config
8+
~/.gitconfig.canonical: git/canonical

install

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
set -e;
3+
pushd . > '/dev/null';
4+
repo_dir="${BASH_SOURCE[0]:-$0}";
5+
while [ -h "${repo_dir}" ]; do
6+
cd "$(dirname -- "${repo_dir}")";
7+
repo_dir="$(readlink -f -- "${repo_dir}")";
8+
done;
9+
10+
cd "$(dirname -- "${repo_dir}")" > '/dev/null';
11+
repo_dir="$(pwd)";
12+
popd > '/dev/null';
13+
14+
config="${repo_dir}/.install.yaml";
15+
dotbot_dir="${repo_dir}/.dotbot";
16+
dotbot_bin="${dotbot_dir}/bin/dotbot";
17+
18+
git -C "${dotbot_dir}" submodule sync --quiet --recursive;
19+
git submodule update --init --recursive "${dotbot_dir}";
20+
21+
"${dotbot_bin}" -d "${repo_dir}" -c "${config}" "${@}";

0 commit comments

Comments
 (0)