Skip to content

Commit 1dc1680

Browse files
committed
Update decontainer install
1 parent a997f7f commit 1dc1680

File tree

2 files changed

+30
-40
lines changed

2 files changed

+30
-40
lines changed

scripts/devcontainer.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ print_details
1414
apt_update
1515
apt_install \
1616
fzf \
17-
golang-go \
18-
npm \
1917
pass \
20-
python3-venv \
2118
software-properties-common \
2219
stow \
2320
wget \
@@ -27,10 +24,6 @@ apt_install \
2724
# change to zsh as default shell
2825
sudo chsh -s /usr/bin/zsh
2926

30-
# ensure that submodules are downloaded
31-
git submodule init
32-
git submodule update
33-
3427
# ensure that .config is owned by the current user
3528
if [[ -d $HOME/.config && ! $(stat -c "%U" $HOME/.config) == "$(whoami)" ]]; then
3629
sudo chown $(id -u):$(id -g) $HOME/.config
@@ -45,9 +38,6 @@ wget https://github.com/neovim/neovim-releases/releases/download/v0.10.1/nvim.ap
4538
sudo mv nvim.appimage /usr/bin/nvim
4639
sudo chmod u+x /usr/bin/nvim
4740

48-
curl https://sh.rustup.rs -sSf | bash -s -- -y
49-
source $HOME/.cargo/env
50-
5141
zsh_extras
5242

5343
starship_install

scripts/utils.sh

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,27 @@ ORANGE='\033[0;33'
1212
RED='\033[0;31m'
1313
RESET='\033[0m'
1414

15-
function LOG(){
15+
function LOG() {
1616
echo -e "$@ ${RESET}"
1717
}
1818

19-
function INFO(){
19+
function INFO() {
2020
LOG ${GREEN}$@
2121
}
2222

23-
function WARN(){
23+
function WARN() {
2424
LOG ${ORANGE}$@
2525
}
2626

27-
function ERROR(){
27+
function ERROR() {
2828
LOG ${RED}$@
2929
}
3030

3131
# print the current system details
3232
# this expects DOTFILES_DIR and SYSTEM to be defined
33-
function print_details(){
33+
function print_details() {
3434
LOG ${BWHITE} \
35-
"
35+
"
3636
SYSTEM: $SYSTEM
3737
OS: $OS
3838
KERNEL: $KERNEL
@@ -47,82 +47,82 @@ DOTFILES_DIR: $DOTFILES_DIR
4747

4848
# function to create my links
4949
# This expects the variable $DOTFILES_DIR to exist
50-
function sym_links(){
50+
function sym_links() {
5151
INFO "Creating symlinks..."
5252
mkdir -p $HOME/.config
5353
stow -v --dotfiles --adopt --dir $DOTFILES_DIR --target $HOME --restow home
54-
stow -v --adopt --dir $DOTFILES_DIR/private/ --target $HOME/.ssh --restow .ssh
54+
[[ -d $DOTFILES/private/.ssh ]] && stow -v --adopt --dir $DOTFILES_DIR/private/ --target $HOME/.ssh --restow .ssh
5555
stow -v --adopt --dir $DOTFILES_DIR --target $HOME/.config/ --restow config
5656
# if the adopt made a local change then undo that
5757
git checkout HEAD -- config home private
5858

5959
return 0
6060
}
6161

62-
function ask(){
62+
function ask() {
6363
read -p "$1 [$2] " answer
6464
answer="${answer:-$2}"
6565
case "$answer" in
66-
y|Y ) return 0;;
67-
n|N ) return 1;;
68-
* ) ask "$1" "$2";;
66+
y | Y) return 0 ;;
67+
n | N) return 1 ;;
68+
*) ask "$1" "$2" ;;
6969
esac
7070
}
7171

7272
############################### Ubuntu specifics #########################################
73-
function no_ppa_exists(){
74-
ppa_added=`grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* | grep -v list.save | grep -v deb-src | grep deb | grep $1 | wc -l`
75-
[ $ppa_added == 0 ];
73+
function no_ppa_exists() {
74+
ppa_added=$(grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* | grep -v list.save | grep -v deb-src | grep deb | grep $1 | wc -l)
75+
[ $ppa_added == 0 ]
7676
}
7777

78-
function add_ppa(){
78+
function add_ppa() {
7979
sudo add-apt-repository ppa:$1 -y
8080
apt_update
8181

8282
return 0
8383
}
8484

85-
function apt_update(){
85+
function apt_update() {
8686
sudo apt-get update 1>/dev/null
8787
}
8888

89-
function apt_install(){
89+
function apt_install() {
9090
sudo apt-get install -y $@
9191

9292
return 0
9393
}
9494

95-
function pac_update(){
95+
function pac_update() {
9696
sudo pacman -Syu --noconfirm
9797

9898
return 0
9999
}
100100

101-
function pac_install(){
101+
function pac_install() {
102102
sudo pacman -S --needed --noconfirm $@
103103

104104
return 0
105105
}
106106

107-
function yay_install(){
107+
function yay_install() {
108108
yay -S --needed --noconfirm $@ --mflags "--nocheck"
109109

110110
return 0
111111
}
112112

113-
function yay_update(){
113+
function yay_update() {
114114
yay -Syu --noconfirm
115115

116116
return 0
117117
}
118118

119-
function pip3_install(){
119+
function pip3_install() {
120120
sudo -H pip3 install $@
121121

122122
return 0
123123
}
124124

125-
function sudo_rule(){
125+
function sudo_rule() {
126126
INFO "$USER ALL = NOPASSWD: $@" | sudo tee -a /etc/sudoers
127127

128128
return 0
@@ -131,7 +131,7 @@ function sudo_rule(){
131131
############################ manual install items ########################################
132132

133133
# setup fzf
134-
function fzf_install(){
134+
function fzf_install() {
135135
mkdir -p $HOME/.local/bin
136136
rm -rf $HOME/.fzf
137137
git clone --depth 1 https://github.com/junegunn/fzf.git $HOME/.fzf
@@ -142,7 +142,7 @@ function fzf_install(){
142142
}
143143

144144
# install lazygit
145-
function lazygit_install(){
145+
function lazygit_install() {
146146
LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | \grep -Po '"tag_name": "v\K[^"]*')
147147
cd /tmp
148148
curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
@@ -152,7 +152,7 @@ function lazygit_install(){
152152
}
153153

154154
# install lunarvim
155-
function lunarvim_install(){
155+
function lunarvim_install() {
156156
INFO "Installing LunarVIM..."
157157
NPM_CONFIG_PREFIX=$HOME/npm-global
158158

@@ -163,7 +163,7 @@ function lunarvim_install(){
163163
}
164164

165165
# setup starship
166-
function starship_install(){
166+
function starship_install() {
167167
INFO "Installing starship..."
168168
curl -sS https://starship.rs/install.sh -o starship.sh
169169
chmod +x starship.sh
@@ -172,7 +172,7 @@ function starship_install(){
172172
}
173173

174174
# install the various zsh components
175-
function zsh_extras(){
175+
function zsh_extras() {
176176
INFO "Setting up zsh extras..."
177177
# install zgenom
178178
[ ! -d $HOME/.zgenom ] && git clone https://github.com/jandamm/zgenom.git ${HOME}/.zgenom
@@ -183,5 +183,5 @@ function zsh_extras(){
183183
# install fonts
184184
mkdir -p $HOME/.local/bin
185185
curl -fsSL https://raw.githubusercontent.com/getnf/getnf/main/install.sh | bash
186-
$HOME/.local/bin/getnf -i DejaVuSansMono,DroidSansMono,Hack,Recursive,RobotoMono | true # don't fail on fonts
186+
$HOME/.local/bin/getnf -i DejaVuSansMono,DroidSansMono,Hack,Recursive,RobotoMono | true # don't fail on fonts
187187
}

0 commit comments

Comments
 (0)