-
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.
This commit adds a configure script to the repository. The configure script handles the installation of necessary dependencies and sets up the environment. This commit ensures that the project has all the required dependencies and a proper environment for development. Signed-off-by: Schubert Anselme <[email protected]>
- Loading branch information
Showing
5 changed files
with
112 additions
and
86 deletions.
There are no files selected for viewing
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
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,73 @@ | ||
#!/bin/bash | ||
# SPDX-License-Identifier: GPL-3.0 | ||
|
||
DIR="$(dirname $(realpath $(dirname "${0}")))" | ||
source "${DIR}/scripts/aliases.sh" | ||
source "${DIR}/scripts/environment.sh" | ||
|
||
# dependencies | ||
if [[ -n $(command -v "apt-get") ]]; then | ||
commands=( | ||
"curl" | ||
"git" | ||
"gnupg2" | ||
"zsh" | ||
) | ||
|
||
sudo apt-get update -y | ||
for command in "${commands[@]}"; do | ||
if [[ -z $(command -v "${command}") ]]; then | ||
sudo apt-get install -y "${command}" | ||
fi | ||
done | ||
fi | ||
|
||
# permissions | ||
if [[ -n $(command -v "usermod") ]]; then | ||
groups=( | ||
"docker" | ||
"libvirt" | ||
"plugdev" | ||
"sudo" | ||
) | ||
|
||
for g in "${groups[@]}"; do | ||
sudo usermod -aG "${g}" "${USER}" || true | ||
done | ||
fi | ||
|
||
# environment | ||
if [[ ! -d "${HOME}/.oh-my-zsh" ]]; then | ||
curl -fsSLo /tmp/ohmyzsh-install.sh https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh | ||
bash /tmp/ohmyzsh-install.sh --unattended || true | ||
rm -f /tmp/ohmyzsh-install.sh | ||
fi | ||
|
||
ln -sf \ | ||
"${DIR}/modules/dotfiles/.bashrc" \ | ||
"${DIR}/modules/dotfiles/.zshrc" \ | ||
"${DIR}/modules/dotfiles/.editorconfig" \ | ||
"${DIR}/modules/dotfiles/.commitlintrc" \ | ||
"${DIR}/modules/dotfiles/.idea" \ | ||
"${DIR}/modules/dotfiles/.vscode" \ | ||
"${DIR}/.trunk/configs/."* \ | ||
"${DIR}" | ||
|
||
for ITEM in $(echo """ | ||
${DIR}/modules/dotfiles/.devcontainer | ||
${DIR}/modules/dotfiles/.gitignore | ||
${DIR}/modules/dotfiles/.ssh | ||
${DIR}/modules/dotfiles/.trunk | ||
${DIR}/modules/dotfiles/compose-dev.yaml | ||
"""); do | ||
# copy if not present in "${DIR}" | ||
ls -l $(basename "${ITEM}") > /dev/null 2>&1 || cp -r "${ITEM}" "${DIR}/" | ||
done | ||
|
||
sudo chsh -s "$(command -v zsh)" "${USER}" | ||
|
||
# trunk.io | ||
if [[ -n $(command -v "usermod") ]]; then | ||
trunk fmt | ||
trunk check | ||
fi |
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