-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathjustfile
88 lines (69 loc) · 2.62 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# docs: https://github.com/casey/just/
# cheat-sheet: https://cheatography.com/linux-china/cheat-sheets/justfile/
# template: https://github.com/dsiebel/repository-template/blob/main/Justfile
set shell := ["bash", "-euo", "pipefail", "-c"]
set unstable
set script-interpreter := ['bash', '-euxo', 'pipefail']
docker_machine_name := "default"
_default:
@just --list
# Installs everything
all: bin dotfiles macos vim homebrew-dep
# install bin directory files
[script]
bin:
while IFS= read -r file; do
f="$(basename "$file")"
sudo ln -sf "$file" "/usr/local/bin/$f"
done< <(find "{{ justfile_directory() }}/bin" -type f -not -name "meldDiff" -not -name ".*.swp" -not -name "vgaswitcheroo.sh")
# install the dotfiles for current user
[script]
dotfiles:
git submodule init
git submodule update
while IFS= read -r file; do
f="$(basename "${file}")"
ln -sfn "${file}" "${HOME}/$f"
done < <(find "{{ justfile_directory() }}" -type f -name ".*" -depth 1 -not -name ".git*" -not -name ".*.swp" -not -name ".gnupg")
# special handling for .git* files to not mess with the repo
while IFS= read -r file; do
f="$(basename ${file})"
echo ln -sfn "${file}" "${HOME}/${f/#dot/\.}"
done< <(find {{ justfile_directory() }}/dotgit -name "dotgit*" -depth 1)
# special handling for directories
echo ln -sfn "{{ justfile_directory() }}/.oh-my-zsh" "${HOME}/.oh-my-zsh"
echo ln -sfn "{{ justfile_directory() }}/.zsh-custom" "${HOME}/.zsh-custom"
# we can not link the entire `.config` dir, it would only clutter up the git checkout
mkdir -p "${HOME}/.config"
echo ln -sfn "{{ justfile_directory() }}/.config/starship.toml" "${HOME}/.config/starship.toml"
# setup macos
macos:
"{{ justfile_directory() }}/macos.sh"
# install amix/vimrc
vim:
"{{ justfile_directory() }}/vim.sh"
# install homebrew
[script]
homebrew:
if ! command -v brew; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
# install brews
homebrew-dep: homebrew
"{{ justfile_directory() }}/homebrew-dep.sh"
# install front via homebrew
[script]
homebrew-fonts: homebrew
brew bundle install --file "{{ justfile_directory() }}/Brewfile-fonts"
# install vscode extensions
vscode-ext:
"{{ justfile_directory() }}/vscode/install-vscode-extensions" "{{ justfile_directory() }}/vscode/extensions.txt"
# set up docker-machine. Use docker_machine_name to overwrite machine name
docker-machine:
"{{ justfile_directory() }}/docker-machine.sh" "{{ docker_machine_name }}"
# Runs all the tests on the files in the repository.
test: shellcheck
# Runs the shellcheck tests on the scripts.
[script]
shellcheck:
pre-commit run --all-files shellcheck