-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·255 lines (229 loc) · 5.71 KB
/
install.sh
File metadata and controls
executable file
·255 lines (229 loc) · 5.71 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
#!/usr/bin/env bash
# Author: Francis Pelletier
# Date : January 2021
# This script is part of this project : https://github.com/f-PLT/dev-setup-scripts
# This script will configure everything. It is meant to be run
# on a newly installed system, or one meant to become a new
# developement environment.
#
# Tested with Ubuntu 24.04, as well a Vagrant
#
# Use at your own risks.
if [ -d scripts ]; then
BASE_DEVSETUP_PATH=$(dirname "$(realpath $0)")
else
BASE_DEVSETUP_PATH=$HOME/.dev-setup
fi
SCRIPT_FOLDER_PATH=$BASE_DEVSETUP_PATH/scripts
add_local_bin_to_path() {
local target_dir="$HOME/.local/bin"
# Check if the directory exists and is not already in PATH
if [ -d "$target_dir" ] && [[ ":$PATH:" != *":$target_dir:"* ]]; then
export PATH="$target_dir:$PATH"
echo "Added $target_dir to PATH."
else
echo "$target_dir is already in PATH or does not exist."
fi
}
# basic tools scripts
basictools () {
(cd $SCRIPT_FOLDER_PATH && ./basictools.sh)
}
# bash configuration
bashconf () {
(cd $SCRIPT_FOLDER_PATH && ./bashconf.sh)
}
# ctools
c () {
(cd $SCRIPT_FOLDER_PATH && ./ctools.sh)
}
# dockertools
docker-deps () {
(cd $SCRIPT_FOLDER_PATH && ./dockertools_config.sh)
}
ide () {
echo 'Installing VS Code'
sudo snap install code --classic
}
# javatools
java () {
(cd $SCRIPT_FOLDER_PATH && ./javatools_config.sh)
}
# pythontools
python-deps () {
add_local_bin_to_path
(cd $SCRIPT_FOLDER_PATH && ./pythontools_config.sh)
}
# miniforge
miniforge () {
add_local_bin_to_path
(cd $SCRIPT_FOLDER_PATH && ./miniforge.sh)
}
# micromamba
micromamba () {
add_local_bin_to_path
(cd $SCRIPT_FOLDER_PATH && ./micromamba.sh)
}
# Setting things in to place
setup () {
add_local_bin_to_path
# System update
sudo apt-get update
curl -V
if [ $? != "0" ]; then
sudo apt-get install curl -y
fi
git --version
if [ $? != "0" ]; then
sudo apt-get install git -y
fi
# Fetch repo
if [ ! -d $SCRIPT_FOLDER_PATH ]; then
git clone https://github.com/f-PLT/dev-setup-scripts.git $BASE_DEVSETUP_PATH
else
(cd $BASE_DEVSETUP_PATH && git pull)
fi
}
# vim configuration
vimconf () {
(cd $SCRIPT_FOLDER_PATH && ./vimconf.sh)
}
# webtools
web () {
(cd $SCRIPT_FOLDER_PATH && ./webtools_config.sh)
}
# Preset installations
all () {
setup
bashconf
basictools
vimconf
python-deps
miniforge
docker-deps
java
c
web
ide
}
docker-dev () {
setup
bashconf
vimconf
basictools
docker-deps
}
python-dev () {
setup
bashconf
vimconf
basictools
python-deps
micromamba
}
headless () {
setup
bashconf
vimconf
basictools
python-deps
miniforge
docker-deps
web
}
list () {
echo " List of available configurations:"
echo
echo " - bashconf : Set .bashrc file. This will overwrite your .bashrc file,"
echo " Run this first, as python and other configurations"
echo " will modify this file too"
echo " - basictools : Basic packages and vim configuration."
echo " - c : C libraries"
echo " - docker-deps : Docker installation and configuration"
echo " - ide : Install Vscode"
echo " - java : Open JDK, maven, gradle"
echo " - micromamba : Install Micromamba"
echo " - miniforge : Install Conda and Mamba through Miniforge3"
echo " - python-deps : Python libraries, UV and Poetry"
echo " - setup : Updates system, fetches repository."
echo " Run this first if you downloaded install.sh file only"
echo " - vimconf : Set .vimrc file. This will overwrite your .vimrc file."
echo " - web : NVM, Yarn and"
echo
echo " Preset installation packages:"
echo
echo " - all : Installs everything"
echo " - docker-dev : Install docker selection:"
echo " basictools, bashconf, vimconf, docker"
echo " - headless : Installs headless selection:"
echo " basictools, bashconf, vimconf, docker, python, miniforge"
echo " and web."
echo " - python-dev : Installs basic python selection:"
echo " basictools, bashconf, vimconf, python, micromamba"
}
if [[ "$#" -eq 0 ]]; then
list
fi
for var in "$@"
do
# Order is set according to use, not alphabetical order
case "$var" in
"list")
list
;;
"headless")
headless
;;
"setup")
setup
;;
"bashconf")
bashconf
;;
"basictools")
basictools
;;
"vimconf")
vimconf
;;
"ide")
ide
;;
"python-deps")
python-deps
;;
"python-dev")
python-dev
;;
"miniforge")
miniforge
;;
"micromamba")
micromamba
;;
"web")
web
;;
"docker-deps")
docker-deps
;;
"docker-dev")
docker-dev
;;
"java")
java
;;
"c")
c
;;
"all")
all
;;
*)
echo "* * * * * * * * * * * * * * * * * * * * * * * * * "
echo "* ""$var"" is not a valid input "
echo "* Use the list command to see available inputs"
echo "* * * * * * * * * * * * * * * * * * * * * * * * *"
exit 1
esac
done