Skip to content

Commit

Permalink
support debian systems v1
Browse files Browse the repository at this point in the history
  • Loading branch information
pPrecel committed Aug 27, 2024
1 parent a266903 commit db2884d
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 24 deletions.
40 changes: 26 additions & 14 deletions bootstrap.fish
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,25 @@ 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"
if [ "$(uname -s)" = "Linux" ]
make 'check prerequisites'
and type -q fish
and type -q apt
and type -q git
and type -q vim
and type -q curl
and success 'check prerequisites'
or abort "Install 'fish', 'git', 'vim', 'curl', and 'apt' first"
else
make 'check prerequisites'
and type -q fish
and type -q brew
and type -q git
and type -q vim
and type -q curl
and success 'check prerequisites'
or abort "Install 'fish', 'git', 'vim', 'curl', and 'brew' first"
end

for init in pre_modules/*/init.fish
set -l STEP_NAME $(basename $(dirname $init))
Expand All @@ -25,10 +37,10 @@ for init in pre_modules/*/init.fish
or abort Aborted $STEP_NAME
end

for init in modules/*/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 modules/*/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
2 changes: 1 addition & 1 deletion pre_modules/krew/init.fish
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ source $DOTFILES_ROOT/lib/*
set -l temp_dir (mktemp -d)

pushd $temp_dir
set -l _OS (uname | tr '[:upper:]' '[:lower:]')
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"
Expand Down
Empty file added pre_modules/pkg_manager/apt
Empty file.
19 changes: 19 additions & 0 deletions pre_modules/pkg_manager/apt.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env fish

set DOTFILES_ROOT (pwd -P)
source $DOTFILES_ROOT/lib/lib.fish

make 'Add apt multiverse repo'
and sudo add-apt-repository multiverse --yes 1>/dev/null
and success 'Add apt multiverse repo'
or abort 'Add apt multiverse repo'

make 'Add apt universe repo'
and sudo add-apt-repository universe --yes 1>/dev/null
and success 'Add apt universe repo'
or abort 'Add apt universe repo'

make 'Update apt'
and sudo apt update --yes 1>/dev/null
and success 'Update apt'
or abort 'Update apt'
22 changes: 13 additions & 9 deletions pre_modules/pkg_manager/init.fish
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@
set DOTFILES_ROOT (pwd -P)
source $DOTFILES_ROOT/lib/lib.fish

set BREW_INSTALL $DOTFILES_ROOT/pre_modules/pkg_manager/brew.fish
if [ "$(uname -s)" = "Linux" ]
fish $DOTFILES_ROOT/pre_modules/pkg_manager/apt.fish
else
set BREW_INSTALL $DOTFILES_ROOT/pre_modules/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'
# 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"

$BREW_INSTALL 'brew_cask' "true"
$BREW_INSTALL 'brew_cask' "true"

$BREW_INSTALL 'brew_custom'
$BREW_INSTALL 'brew_custom'
end

0 comments on commit db2884d

Please sign in to comment.