Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ tmux/.config/tmux/plugins/tpm/
node_modules/
zsh/.config/zsh/envs/
zshrc
nvim/.config/nvim/lazy-lock.json
2 changes: 1 addition & 1 deletion asdf/.config/asdf/.asdfrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use_release_candidates = no
# * ASDF_DEFAULT_TOOL_VERSIONS_FILENAME - The name of the file storing the tool names and versions.
# Defaults to .tool-versions. Can be any valid file name.

# Mac OS X
# Mac OS X
# ---------
# Some applications in macOS use `/usr/libexec/java_home` to set java home.
# Setting java_macos_integration_enable to yes on .asdfrc file enables this integration.
Expand Down
165 changes: 0 additions & 165 deletions asdf/.config/asdf/default-ctags

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// allows comments
github.com/Dreamacro/clash
github.com/jesseduffield/lazygit
//github.com/jesseduffield/lazygit
1 change: 0 additions & 1 deletion asdf/.config/asdf/default-npm-packages
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ request
ts-node
typescript
typescript-language-server

2 changes: 1 addition & 1 deletion git/.config/git/config
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
defaultBranch = main

[core]
excludesfile = ~/.gitignore_global
excludesfile = ~/.config/git/gitignore_global
editor = nvim

[github]
Expand Down
10 changes: 6 additions & 4 deletions installer/1password_formula.bash
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
# -----------------------------------------------------------------------------
function install_1password() {

echo "+----------------------------------------------------------+"
echo "| *** 🗝️ Instalador do 1Password *** |"
echo "+----------------------------------------------------------+"

if [ -f /opt/1Password/op-ssh-sign ]; then
echo "✔️ 1Password já instalado."
return
fi

echo "🗝️ Instalando 1Password..."

case $PLATFORM_OS in
Fedora)
install_1password_fedora
Expand Down Expand Up @@ -62,7 +64,7 @@ function install_1password() {
function install_1password_debian_or_ubuntu() {
_add_key_for_the_1Password_apt_repository_and_add_apt_repo
sudo apt-get update -qq
sudo apt-get install -y 1password
sudo apt-get install -qq -y 1password
}

function _add_key_for_the_1Password_apt_repository_and_add_apt_repo() {
Expand Down Expand Up @@ -96,7 +98,7 @@ function _add_key_for_the_1Password_apt_repository_and_add_apt_repo() {
# -----------------------------------------------------------------------------
function install_1password_fedora() {
_add_key_for_the_1Password_yum_repository
sudo dnf install -y 1password
sudo dnf install -q -y 1password
}

function _add_key_for_the_1Password_yum_repository() {
Expand Down
59 changes: 59 additions & 0 deletions installer/asdf_formula.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/bash

function install_asdf() {

echo "+----------------------------------------------------------+"
echo "| *** 🧩 Instalador do ASDF *** |"
echo "+----------------------------------------------------------+"

if command -v asdf >/dev/null 2>&1; then
echo "ASDF-VM já está instalado."
return
fi
REPO="asdf-vm/asdf"
INSTALL_DIR="/usr/local/bin"

export ASDF_DIR="$HOME/.local/share/asdf"
mkdir -p "$ASDF_DIR"


# Obtém a última versão do release via GitHub API
LATEST_TAG=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" | grep -oP '"tag_name": "\K(.*)(?=")')
VERSION="${LATEST_TAG#v}" # Remove o 'v' inicial, se presente
case $PLATFORM_OS in
Fedora)
ARCHIVE_URL="https://github.com/$REPO/releases/download/$LATEST_TAG/asdf-$LATEST_TAG-linux-amd64.tar.gz"
;;
Ubuntu)
ARCHIVE_URL="https://github.com/$REPO/releases/download/$LATEST_TAG/asdf-$LATEST_TAG-linux-amd64.tar.gz"
;;
MacOS)
ARCHIVE_URL="https://github.com/$REPO/releases/download/$LATEST_TAG/asdf-$LATEST_TAG-darwin-arm64.tar.gz"
;;
*)
echo "Invalid option $PLATFORM_ARCH"
esac

#ARCHIVE_URL="https://github.com/$REPO/archive/refs/tags/$LATEST_TAG.tar.gz"

echo "Baixando $ARCHIVE_URL..."
curl -L "$ARCHIVE_URL" -o "/tmp/asdf-$LATEST_TAG.tar.gz"

# Extrai para /usr/local/bin
echo "Extraindo para $INSTALL_DIR..."
sudo tar -xzf "/tmp/asdf-$LATEST_TAG.tar.gz" -C "$INSTALL_DIR"

# Opcional: mostra conteúdo extraído
echo "Conteúdo extraído:"
# ln -sf "$INSTALL_DIR/asdf-$VERSION" "$INSTALL_DIR/asdf"
ls -l "$INSTALL_DIR/" | grep -i asdf

# Limpeza
rm "/tmp/asdf-$LATEST_TAG.tar.gz"

$INSTALL_DIR/asdf --version
echo "Instalação do asdf $VERSION concluída."
echo "Adicione o seguinte ao seu arquivo de configuração do shell (ex: ~/.zshrc ou ~/.bashrc):"
echo " source /usr/local/bin/asdf-$LATEST_TAG/asdf.sh"
echo " source /usr/local/bin/asdf-$LATEST_TAG/completions/asdf.bash"
}
2 changes: 2 additions & 0 deletions installer/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ source ./installer/lazy_packages.bash
source ./installer/zplug_formula.bash
source ./installer/tmux_formula.bash
source ./installer/1password_formula.bash
source ./installer/asdf_formula.bash

export XDG_CONFIG_HOME=$HOME/.config

Expand Down Expand Up @@ -49,6 +50,7 @@ main() {
ensure_zplug_installed
ensure_tmux_tpm_installed
install_1password
install_asdf
echo "🎉 Bootstrap concluído com sucesso!"
}

Expand Down
1 change: 1 addition & 0 deletions installer/brew_packages.bash
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ install_macos_packages() {
brew "xclip"
brew "editorconfig-checker"
brew "zplug"
brew "coreutils"
EOF
}
2 changes: 1 addition & 1 deletion installer/debian_packages.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ install_debian_packages() {
echo "🌀 Plataforma Ubuntu/Debian detectada."
echo "📦 Instalando pacotes..."
sudo apt-get update -qq
sudo apt-get install -y build-essential apt-transport-https curl git gnupg2 libffi-dev libpq-dev libreadline-dev lua5.3 python3 python3-dev python3-pip tmux wget xclip neovim stow zsh stow ripgrep fd-find jq tmux
sudo apt-get install -qq -y build-essential apt-transport-https curl coreutils git gnupg2 libffi-dev libpq-dev libreadline-dev lua5.3 python3 python3-dev python3-pip tmux wget xclip neovim stow zsh stow ripgrep fd-find jq tmux
if ! command -v lazygit >/dev/null; then
install_lazygit_from_source
fi
Expand Down
2 changes: 1 addition & 1 deletion installer/fedora_packages.bash
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ install_fedora_packages() {
sudo dnf groupinstall -y '@development-tools' '@development-libraries'
sudo dnf install -q -y util-linux-user
sudo dnf install -q -y git kernel-devel libffi-devel libpq-devel editorconfig-checker lua make nodejs python3 python3-devel python3-pip readline readline-devel tmux wget xclip
sudo dnf install -y ripgrep zsh fd-find lazygit lazydocker jq stow neovim tmux
sudo dnf install -q -y ripgrep zsh fd-find lazygit lazydocker jq stow neovim tmux

if command -v fd >/dev/null; then
echo "✔️ fd já instalado"
Expand Down
2 changes: 0 additions & 2 deletions installer/zplug_formula.bash
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,5 @@ function creates_zsh_envs_to_zplug() {
mkdir -p $XDG_CONFIG_HOME/zsh/envs
fi

echo "export ZPLUG_HOME=$XDG_CONFIG_HOME/zsh/plugins/zplug" > $XDG_CONFIG_HOME/zsh/envs/zplug.env.zsh
echo "source \$ZPLUG_HOME/init.zsh" >> $XDG_CONFIG_HOME/zsh/envs/zplug.env.zsh
echo "Arquivos de configuração do zsh para zplug criados com sucesso."
}
5 changes: 5 additions & 0 deletions tests/01-validate-packages.test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ load test_helper
[ "$status" -eq 0 ]
}

@test "it asdf be present" {
run command -v asdf
[ "$status" -eq 0 ]
}

# @test "it fd be present" {
# run command -v fd
# [ "$status" -eq 0 ]
Expand Down
13 changes: 13 additions & 0 deletions tests/02-stow-structure.test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,16 @@ load test_helper
@test "it MCPHUB folder in XDG_CONFIG_HOME exists in the new structure" {
assert_dir_exists "$HOME/.config/mcphub"
}

@test "it asdf folder in XDG_CONFIG_HOME exists in the new structure" {
assert_dir_exists "$HOME/.config/asdf"
assert_dir_exists "$HOME/.local/share/asdf"
}

@test "it asdf executable on /usr/local/bin exists" {
echo "DEBUG: Checking if asdf exists in /usr/local/bin PATH=$PATH"
ls -lah /usr/local/bin | grep asdf
assert_file_exists "/usr/local/bin/asdf"
run command -v asdf
[ "$status" -eq 0 ]
}
Loading
Loading