add code ext
This commit is contained in:
@@ -68,27 +68,75 @@ sudo apt update
|
||||
sudo apt install -y code
|
||||
check_command "Visual Studio Code"
|
||||
|
||||
# Installazione estensioni VS Code
|
||||
print_status "Installazione estensioni VS Code..."
|
||||
# Python
|
||||
code --install-extension ms-python.python
|
||||
code --install-extension ms-python.flake8
|
||||
code --install-extension ms-python.python-tools
|
||||
code --install-extension ms-python.vscode-pylance
|
||||
code --install-extension ms-python.vscode-pyright
|
||||
code --install-extension ms-python.debugpy
|
||||
# Rust
|
||||
code --install-extension rust-lang.rust-analyzer
|
||||
code --install-extension formulahendry.code-runner
|
||||
code --install-extension vadimcn.vscode-lldb
|
||||
code --install-extension fill-labs.dependi
|
||||
code --install-extension usernamehw.errorlens
|
||||
code --install-extension tamasfe.even-better-toml
|
||||
# Git
|
||||
code --install-extension ms-vscode.vscode-git
|
||||
code --install-extension charliermarsh.ruff
|
||||
code --install-extension google.geminicodeassist
|
||||
print_success "Estensioni VS Code installate"
|
||||
# Creazione profili e installazione estensioni VS Code
|
||||
print_status "Creazione profili e installazione estensioni VS Code..."
|
||||
|
||||
# Aspetta che VS Code sia completamente installato
|
||||
sleep 2
|
||||
|
||||
# Prima creiamo i profili avviando VS Code con ciascun profilo
|
||||
print_status "Creazione profili VS Code..."
|
||||
|
||||
# Funzione per creare un profilo
|
||||
create_vscode_profile() {
|
||||
local profile_name="$1"
|
||||
print_status "Creando profilo $profile_name..."
|
||||
|
||||
# Avvia VS Code con il profilo per crearlo, poi lo chiude subito
|
||||
timeout 10 code --profile "$profile_name" --wait /tmp 2>/dev/null || true
|
||||
sleep 2
|
||||
|
||||
# Chiude tutte le istanze di VS Code
|
||||
pkill -f "code.*$profile_name" 2>/dev/null || true
|
||||
sleep 1
|
||||
}
|
||||
|
||||
# Crea i profili
|
||||
create_vscode_profile "Default"
|
||||
create_vscode_profile "Python"
|
||||
create_vscode_profile "Rust"
|
||||
create_vscode_profile "Web"
|
||||
|
||||
print_success "Profili VS Code creati"
|
||||
|
||||
# Ora installiamo le estensioni per ogni profilo
|
||||
print_status "Installazione estensioni per profilo Default..."
|
||||
code --profile "Default" --install-extension ms-vscode.vscode-git
|
||||
code --profile "Default" --install-extension charliermarsh.ruff
|
||||
code --profile "Default" --install-extension google.geminicodeassist
|
||||
code --profile "Default" --install-extension ms-vscode.theme-tomorrowkit
|
||||
code --profile "Default" --install-extension ms-vscode.vscode-git
|
||||
code --profile "Default" --install-extension pkief.material-icon-theme
|
||||
check_command "Estensioni profilo Default"
|
||||
|
||||
print_status "Installazione estensioni per profilo Python..."
|
||||
code --profile "Python" --install-extension ms-python.black-formatter
|
||||
code --profile "Python" --install-extension ms-python.debugpy
|
||||
code --profile "Python" --install-extension ms-python.flake8
|
||||
code --profile "Python" --install-extension ms-python.pylint
|
||||
code --profile "Python" --install-extension ms-python.python
|
||||
code --profile "Python" --install-extension ms-python.python-tools
|
||||
code --profile "Python" --install-extension ms-python.vscode-pylance
|
||||
code --profile "Python" --install-extension ms-python.vscode-pyright
|
||||
check_command "Estensioni profilo Python"
|
||||
|
||||
print_status "Installazione estensioni per profilo Rust..."
|
||||
code --profile "Rust" --install-extension fill-labs.dependi
|
||||
code --profile "Rust" --install-extension formulahendry.code-runner
|
||||
code --profile "Rust" --install-extension rust-lang.rust-analyzer
|
||||
code --profile "Rust" --install-extension serayuzgur.crates
|
||||
code --profile "Rust" --install-extension tamasfe.even-better-toml
|
||||
code --profile "Rust" --install-extension usernamehw.errorlens
|
||||
check_command "Estensioni profilo Rust"
|
||||
|
||||
print_status "Installazione estensioni per profilo Web..."
|
||||
code --profile "Web" --install-extension ms-vscode.vscode-typescript-next
|
||||
code --profile "Web" --install-extension bradlc.vscode-tailwindcss
|
||||
code --profile "Web" --install-extension formulahendry.auto-rename-tag
|
||||
code --profile "Web" --install-extension esbenp.prettier-vscode
|
||||
check_command "Estensioni profilo Web"
|
||||
|
||||
print_success "Tutti i profili VS Code configurati (Default, Python, Rust, Web)"
|
||||
|
||||
# === FILEZILLA ===
|
||||
print_status "Installazione FileZilla..."
|
||||
@@ -197,19 +245,19 @@ rm -rf "$TEMP_REPO_DIR"
|
||||
print_status "Cloning repository alex/desktop-app..."
|
||||
if git clone "https://$GITEA_USERNAME:$GITEA_PASSWORD@gitbat.duckdns.org:44443/alex/desktop-app.git" "$TEMP_REPO_DIR" 2>/dev/null; then
|
||||
print_success "Repository clonato con successo"
|
||||
|
||||
|
||||
# Copia tutti i file .desktop dal repository
|
||||
if [ -d "$TEMP_REPO_DIR" ] && [ "$(ls -A $TEMP_REPO_DIR/*.desktop 2>/dev/null)" ]; then
|
||||
cp "$TEMP_REPO_DIR"/*.desktop "$DESKTOP_DIR/" 2>/dev/null || true
|
||||
|
||||
|
||||
# Rende eseguibili i file .desktop
|
||||
chmod +x "$DESKTOP_DIR"/*.desktop 2>/dev/null || true
|
||||
|
||||
|
||||
# Aggiorna il database delle applicazioni
|
||||
update-desktop-database "$DESKTOP_DIR" 2>/dev/null || true
|
||||
|
||||
|
||||
print_success "File .desktop installati dal repository Gitea"
|
||||
|
||||
|
||||
# Lista dei file installati
|
||||
INSTALLED_FILES=$(ls "$TEMP_REPO_DIR"/*.desktop 2>/dev/null | xargs -n1 basename)
|
||||
if [ ! -z "$INSTALLED_FILES" ]; then
|
||||
@@ -219,13 +267,13 @@ if git clone "https://$GITEA_USERNAME:$GITEA_PASSWORD@gitbat.duckdns.org:44443/a
|
||||
else
|
||||
print_warning "Nessun file .desktop trovato nel repository"
|
||||
fi
|
||||
|
||||
|
||||
# Pulizia
|
||||
rm -rf "$TEMP_REPO_DIR"
|
||||
else
|
||||
print_error "Impossibile clonare il repository. Verifica le credenziali e la connessione."
|
||||
print_status "URL repository: https://gitbat.duckdns.org:44443/alex/desktop-app"
|
||||
|
||||
|
||||
# Fallback: prova con cartella locale
|
||||
BACKUP_DESKTOP_DIR="./desktop_backup"
|
||||
if [ -d "$BACKUP_DESKTOP_DIR" ]; then
|
||||
@@ -252,7 +300,11 @@ fi
|
||||
print_success "=== INSTALLAZIONE COMPLETATA! ==="
|
||||
print_status "Applicazioni installate:"
|
||||
echo " ✓ Google Chrome"
|
||||
echo " ✓ Visual Studio Code (con estensioni Python, Rust, Git, UV, Ruff)"
|
||||
echo " ✓ Visual Studio Code con 4 profili configurati:"
|
||||
echo " - Default (Git, temi)"
|
||||
echo " - Python (Python, Ruff, Flake8, Black, Pylint)"
|
||||
echo " - Rust (Rust Analyzer, LLDB, Crates)"
|
||||
echo " - Web (TypeScript, Tailwind, Auto-rename, Prettier)"
|
||||
echo " ✓ FileZilla"
|
||||
echo " ✓ DBeaver"
|
||||
echo " ✓ Warp Terminal"
|
||||
@@ -277,6 +329,16 @@ echo "Username Git globale: $GIT_USERNAME"
|
||||
echo "Email Git globale: $GIT_EMAIL"
|
||||
echo "Username Gitea: $GITEA_USERNAME"
|
||||
echo ""
|
||||
|
||||
print_status "=== UTILIZZO PROFILI VS CODE ==="
|
||||
echo "Per aprire VS Code con un profilo specifico:"
|
||||
echo " code --profile \"Default\" /percorso/progetto # Profilo generale"
|
||||
echo " code --profile \"Python\" /percorso/progetto # Profilo Python"
|
||||
echo " code --profile \"Rust\" /percorso/progetto # Profilo Rust"
|
||||
echo " code --profile \"Web\" /percorso/progetto # Profilo Web"
|
||||
echo ""
|
||||
echo "Puoi anche cambiare profilo dall'interfaccia: File → Preferences → Profiles"
|
||||
echo ""
|
||||
echo "Per clonare repository da Gitea:"
|
||||
echo " git clone https://gitbat.duckdns.org:44443/user/repo.git"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user