netgescon-master/netgescon-laravel/install-vscode.sh

88 lines
2.8 KiB
Bash
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Script di installazione VS Code su Ubuntu 24.04
# Uso: ./install-vscode.sh
echo "🚀 INSTALLAZIONE VS CODE SU UBUNTU 24.04"
echo "========================================"
echo ""
echo "1⃣ Aggiornamento sistema..."
sudo apt update && sudo apt upgrade -y
echo ""
echo "2⃣ Installazione dipendenze..."
sudo apt install -y \
wget \
gpg \
curl \
software-properties-common \
apt-transport-https \
git \
build-essential
echo ""
echo "3⃣ Download e installazione VS Code..."
# Download della chiave GPG di Microsoft
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
# Aggiornamento e installazione
sudo apt update
sudo apt install -y code
echo ""
echo "4⃣ Installazione estensioni utili..."
code --install-extension ms-vscode.vscode-json
code --install-extension ms-vscode.cpptools
code --install-extension ms-python.python
code --install-extension bradlc.vscode-tailwindcss
code --install-extension bmewburn.vscode-intelephense-client
code --install-extension ms-vscode.atom-keybindings
code --install-extension formulahendry.auto-rename-tag
echo ""
echo "5⃣ Configurazione VS Code per sviluppo Laravel..."
mkdir -p ~/.config/Code/User
cat > ~/.config/Code/User/settings.json << 'EOF'
{
"workbench.colorTheme": "Default Dark+",
"editor.fontSize": 14,
"editor.tabSize": 4,
"editor.insertSpaces": true,
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 1000,
"editor.formatOnSave": true,
"php.suggest.basic": false,
"php.validate.enable": true,
"php.validate.executablePath": "/usr/bin/php",
"intelephense.files.maxSize": 5000000,
"git.enableSmartCommit": true,
"git.autofetch": true,
"terminal.integrated.shell.linux": "/bin/bash"
}
EOF
echo ""
echo "6⃣ Installazione ambiente desktop (se necessario)..."
echo "Controllo se è installato un ambiente desktop..."
if ! command -v gnome-session &> /dev/null && ! command -v startx &> /dev/null; then
echo "Installazione ambiente desktop minimo..."
sudo apt install -y ubuntu-desktop-minimal
echo "NOTA: Riavvio necessario per attivare l'interfaccia grafica"
else
echo "Ambiente desktop già presente"
fi
echo ""
echo "✅ INSTALLAZIONE COMPLETATA!"
echo ""
echo "Per utilizzare VS Code:"
echo "1. Se sei in ambiente grafico: code"
echo "2. Per aprire un progetto: code /percorso/del/progetto"
echo "3. Per aprire il progetto Netgescon: code /var/www/netgescon"
echo ""
echo "Se non hai interfaccia grafica, riavvia il sistema con:"
echo "sudo reboot"