-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
284 additions
and
226 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env fish | ||
# | ||
# bootstrap installs things. | ||
|
||
# set -gx STD_DEBUG /dev/stdout | ||
|
||
set -gx DOTFILES_ROOT (pwd -P) | ||
set -gx FISH_CONFIG "$HOME/.config/fish" | ||
|
||
source $DOTFILES_ROOT/lib/* | ||
|
||
make 'check prerequisites' | ||
and type -q fish | ||
and type -q brew | ||
and type -q git | ||
and type -q vim | ||
and success 'check prerequisites' | ||
or abort "Install 'fish', 'git', 'vim', and 'brew' first" | ||
|
||
for init in install_pre/*/init.fish | ||
set -l STEP_NAME $(basename $(dirname $init)) | ||
make Configuring $STEP_NAME | ||
and run_with_prefix fish $init | ||
and success Configured $STEP_NAME | ||
or abort Aborted $STEP_NAME | ||
end | ||
|
||
for init in install/*/init.fish | ||
set -l STEP_NAME $(basename $(dirname $init)) | ||
make Configuring $STEP_NAME | ||
and run_with_prefix fish $init | ||
and success Configured $STEP_NAME | ||
or abort Aborted $STEP_NAME | ||
end |
This file was deleted.
Oops, something went wrong.
0
fish/conf.d/git.fish → install/fish/conf.d/git.fish
100644 → 100755
File renamed without changes.
0
fish/conf.d/kubectl.fish → install/fish/conf.d/kubectl.fish
100644 → 100755
File renamed without changes.
0
fish/config.fish → install/fish/config.fish
100644 → 100755
File renamed without changes.
0
fish/fisher_list → install/fish/fisher_list
100644 → 100755
File renamed without changes.
0
fish/functions/envdiff.fish → install/fish/functions/envdiff.fish
100644 → 100755
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env fish | ||
|
||
set DOTFILES_ROOT (pwd -P) | ||
set STEP_PATH $DOTFILES_ROOT/install/fish | ||
set FISH_CONFIG "$HOME/.config/fish" | ||
source $DOTFILES_ROOT/lib/* | ||
|
||
set -l plugins (cat $DOTFILES_ROOT/install/fish/fisher_list) | ||
fisher install $plugins >/dev/null | ||
and info_installation_complete "fisher plugins" | ||
or abort "fisher plugins" | ||
|
||
lnWithBackup $STEP_PATH/config.fish $FISH_CONFIG/config.fish | ||
lnFishFolder $STEP_PATH/conf.d $FISH_CONFIG/conf.d | ||
lnFishFolder $STEP_PATH/functions $FISH_CONFIG/functions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
#!/usr/bin/env fish | ||
|
||
source $argv[1]/scripts/common.fish | ||
set DOTFILES_ROOT (pwd -P) | ||
set STEP_PATH $DOTFILES_ROOT/install/iterm2 | ||
source $DOTFILES_ROOT/lib/* | ||
|
||
if test -f /Library/Fonts/"RobotoMonoNerdFont-Regular.ttf" | ||
info_installation_skipped "RobotoMonoNerdFont-Regular.ttf" | ||
else | ||
curl -fLo /Library/Fonts/"RobotoMonoNerdFont-Regular.ttf" \ | ||
https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/RobotoMono/Regular/RobotoMonoNerdFont-Regular.ttf \ | ||
&>/dev/null | ||
>/dev/null | ||
info_installation_complete "RobotoMonoNerdFont-Regular.ttf" | ||
end | ||
|
||
if test -f ~/Library/"Application Support"/iTerm2/DynamicProfiles/natural-fish.json | ||
info_installation_skipped "natural-fish.json" | ||
else | ||
lnWithBackup $argv[1]/iterm2/natural-fish.json \ | ||
lnWithBackup $STEP_PATH/natural-fish.json \ | ||
~/Library/"Application Support"/iTerm2/DynamicProfiles/natural-fish.json | ||
info_installation_complete "natural-fish.json" | ||
end |
0
iterm2/natural-fish.json → install/iterm2/natural-fish.json
100644 → 100755
File renamed without changes.
0
k9s/config.yml → install/k9s/config.yml
100644 → 100755
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env fish | ||
|
||
set DOTFILES_ROOT (pwd -P) | ||
set STEP_PATH $DOTFILES_ROOT/install/k9s | ||
set K9S_CONFIG "$HOME/.config/k9s" | ||
source $DOTFILES_ROOT/lib/* | ||
|
||
mkdir -p $K9S_CONFIG | ||
|
||
lnWithBackup $STEP_PATH/skin.yml \ | ||
$K9S_CONFIG/skin.yml | ||
|
||
info_installation_complete "skin.yml" | ||
|
||
lnWithBackup $STEP_PATH/config.yml \ | ||
$K9S_CONFIG/config.yml | ||
|
||
info_installation_complete "config.yml" | ||
|
||
lnWithBackup $STEP_PATH/plugin.yml \ | ||
$K9S_CONFIG/plugin.yml | ||
|
||
info_installation_complete "plugin.yml" |
0
k9s/plugin.yml → install/k9s/plugin.yml
100644 → 100755
File renamed without changes.
0
k9s/skin.yml → install/k9s/skin.yml
100644 → 100755
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
#!/usr/bin/env fish | ||
|
||
source $argv[1]/scripts/common.fish | ||
set DOTFILES_ROOT (pwd -P) | ||
set STEP_PATH $DOTFILES_ROOT/install/vim | ||
source $DOTFILES_ROOT/lib/* | ||
|
||
if test -f ~/.vim/autoload/plug.vim | ||
info_installation_skipped 'vim-plug' | ||
else | ||
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ | ||
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim &>/dev/null | ||
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim >/dev/null | ||
info_installation_complete 'vim-plug' | ||
end | ||
|
||
lnWithBackup $argv[1]/vim/.vimrc $HOME/.vimrc | ||
lnWithBackup $STEP_PATH/.vimrc $HOME/.vimrc | ||
|
||
mkdir -p $HOME/.config/nvim | ||
lnWithBackup $argv[1]/vim/init.vim $HOME/.config/nvim/init.vim | ||
lnWithBackup $STEP_PATH/init.vim $HOME/.config/nvim/init.vim |
0
vim/init.vim → install/vim/init.vim
100644 → 100755
File renamed without changes.
0
vscode/extensions → install/vscode/extensions
100644 → 100755
File renamed without changes.
10 changes: 6 additions & 4 deletions
10
vscode/init.fish → install/vscode/init.fish
100644 → 100755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0
vscode/settings.json → install/vscode/settings.json
100644 → 100755
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env fish | ||
|
||
set DOTFILES_ROOT (pwd -P) | ||
source $DOTFILES_ROOT/lib/* | ||
|
||
if type -q 'fisher' | ||
info_installation_skipped 'fisher' | ||
else | ||
curl -sL git.io/fisher | source && fisher install jorgebucaran/fisher >/dev/null | ||
info_installation_complete 'fisher' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env fish | ||
|
||
set DOTFILES_ROOT (pwd -P) | ||
source $DOTFILES_ROOT/lib/* | ||
|
||
if test -z (git config --global --get user.email) | ||
ask 'What is your github author email?' | ||
read user_email | ||
test -n $user_email | ||
or abort "empty author email" | ||
end | ||
if test -z (git config --global --get user.name) | ||
ask 'What is your github author name?' | ||
read user_name | ||
test -n $user_name | ||
or abort "empty author name" | ||
end | ||
git config --global user.name $user_name >/dev/null | ||
and git config --global user.email $user_email >/dev/null | ||
or abort 'failed to setup git user name and email' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env fish | ||
|
||
set DOTFILES_ROOT (pwd -P) | ||
source $DOTFILES_ROOT/lib/* | ||
|
||
set -l temp_dir (mktemp -d) | ||
|
||
pushd $temp_dir | ||
set -l _OS (uname | tr '[:upper:]' '[:lower:]') | ||
and set -l _ARCH (uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/') | ||
and set -l _KREW krew-$_OS"_"$_ARCH | ||
and curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/$_KREW.tar.gz" | ||
and tar zxvf $_KREW.tar.gz >/dev/null | ||
and ./$_KREW install krew >/dev/null | ||
popd |
0
scripts/brew_list → install_pre/pkg_manager/brew
100644 → 100755
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env fish | ||
|
||
set DOTFILES_ROOT (pwd -P) | ||
source $DOTFILES_ROOT/lib/* | ||
|
||
set -l file_name $argv[1] | ||
set -l cask $argv[2] | ||
|
||
function install | ||
set -l val $argv[1] | ||
|
||
if brew ls --versions $val >/dev/null | ||
run_with_prefix brew upgrade $val | ||
else if test -n "$cask" | ||
run_with_prefix brew install --cask $val | ||
else | ||
run_with_prefix brew install $val | ||
end | ||
end | ||
|
||
set -l brew_list | ||
while read -la line | ||
set brew_list $brew_list $line | ||
end < $DOTFILES_ROOT/install_pre/pkg_manager/$file_name | ||
|
||
for val in $brew_list | ||
make "Installing $val..." | ||
|
||
install $val | ||
or abort_installation $val | ||
|
||
info_installation_complete $val | ||
end |
0
scripts/brew_list_cask → install_pre/pkg_manager/brew_cask
100644 → 100755
File renamed without changes.
0
scripts/brew_custom → install_pre/pkg_manager/brew_custom
100644 → 100755
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env fish | ||
|
||
set DOTFILES_ROOT (pwd -P) | ||
source $DOTFILES_ROOT/lib/lib.fish | ||
|
||
set BREW_INSTALL $DOTFILES_ROOT/install_pre/pkg_manager/brew.fish | ||
|
||
# TODO: support linux | ||
make 'Update brew' | ||
and run_with_prefix brew update --auto-update | ||
and success 'Updated brew' | ||
or abort 'Updated brew' | ||
|
||
$BREW_INSTALL "brew" | ||
|
||
$BREW_INSTALL 'brew_cask' "true" | ||
|
||
$BREW_INSTALL 'brew_custom' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env fish | ||
|
||
set LIB_PATH (pwd -P)/lib | ||
|
||
source $LIB_PATH/log.fish | ||
source $LIB_PATH/run_with_prefix.fish | ||
source $LIB_PATH/utils.fish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env fish | ||
|
||
function info_installation_complete | ||
success "Installation complete for $argv" | ||
end | ||
|
||
function info_installation_skipped | ||
skip "Installation skipped for $argv" | ||
end | ||
|
||
function info | ||
echo '[ .. ]' $argv &>/dev/stdout | ||
end | ||
|
||
function ask | ||
echo [(set_color --bold yellow)' ?? '(set_color normal)] $argv &>/dev/stdout | ||
end | ||
|
||
function make | ||
echo [(set_color --bold blue)'MAKE'(set_color normal)] $argv &>/dev/stdout | ||
end | ||
|
||
function success | ||
echo [(set_color --bold green)'DONE'(set_color normal)] $argv &>/dev/stdout | ||
end | ||
|
||
function skip | ||
echo [(set_color --bold yellow)'SKIP'(set_color normal)] $argv &>/dev/stdout | ||
end | ||
|
||
function abort | ||
echo [(set_color --bold red)'ABRT'(set_color normal)] $argv &>/dev/stderr | ||
exit 1 | ||
end | ||
|
||
function abort_installation | ||
abort "Installation aborted for '$argv'" &>/dev/stdout | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env fish | ||
|
||
function run_with_prefix | ||
if test $DOTFILES_STREAM | ||
$argv &>$DOTFILES_STREAM_2 | ||
else | ||
# primary stream (stdout/stderr) | ||
set -x DOTFILES_STREAM (mktemp -u) | ||
touch "$DOTFILES_STREAM" | ||
|
||
# double prefixed stream | ||
set -x DOTFILES_STREAM_2 (mktemp -u) | ||
touch "$DOTFILES_STREAM_2" | ||
|
||
tail -f $DOTFILES_STREAM | sed 's/^/ /' & | ||
tail -f $DOTFILES_STREAM_2 | sed 's/^/ /' & | ||
$argv &>$DOTFILES_STREAM | ||
|
||
kill -SIGKILL %2 %1 | ||
rm -f $DOTFILES_STREAM &>/dev/null | ||
end | ||
end |
Oops, something went wrong.