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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ LABEL maintainer="ManghiDev <https://manghi.dev>" \
#* Install necessary dependencies and development tools
RUN apk add --no-cache \
# Core tools
git lazygit fzf curl neovim ripgrep alpine-sdk zsh sudo \
git lazygit fzf curl neovim ripgrep alpine-sdk bash zsh sudo \
# Additional development tools
tmux tree htop unzip zip \
# Language tools
Expand Down
18 changes: 8 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Provides easy-to-use commands for managing the LazyVim Docker environment

.PHONY: default build start enter stop destroy clean status update backup restore dev quick version bump-version restart
.PHONY: install-global uninstall install-remote remote-uninstall remote-update configure
.PHONY: install-global uninstall install-remote configure

# Default target
.DEFAULT_GOAL := default
Expand Down Expand Up @@ -118,9 +118,7 @@ status: ## Show container status
fi

update: ## Update to latest version and rebuild
@echo "$(BLUE)Updating LazyVim environment...$(NC)"
@git pull origin main || echo "$(YELLOW)Could not pull latest changes$(NC)"
@make build
@./scripts/smart-update.sh

backup: ## Backup dotfiles and configuration
@echo "$(BLUE)Creating backup of configuration...$(NC)"
Expand Down Expand Up @@ -169,7 +167,7 @@ install-global: ## Install global 'lazy' commands to use from anywhere

uninstall: ## Complete uninstall - removes everything (same as curl method)
@echo "$(BLUE)Running complete LazyVim Docker uninstall...$(NC)"
@./scripts/remote-uninstall.sh
@./scripts/uninstall.sh

install-remote:
@echo "$(BLUE)LazyVim Docker - Remote Installation$(NC)"
Expand All @@ -185,9 +183,9 @@ install-remote:

remote-install: install-remote

test-remote-scripts:
@echo "$(BLUE)Testing remote installation scripts...$(NC)"
test-scripts:
@echo "$(BLUE)Testing installation scripts...$(NC)"
@bash -n scripts/start.sh && echo "$(GREEN)✓ start.sh syntax OK$(NC)"
@bash -n scripts/remote-uninstall.sh && echo "$(GREEN)✓ remote-uninstall.sh syntax OK$(NC)"
@bash -n scripts/remote-update.sh && echo "$(GREEN)✓ remote-update.sh syntax OK$(NC)"
@echo "$(GREEN)All remote scripts passed syntax check!$(NC)"
@bash -n scripts/uninstall.sh && echo "$(GREEN)✓ uninstall.sh syntax OK$(NC)"
@bash -n scripts/smart-update.sh && echo "$(GREEN)✓ smart-update.sh syntax OK$(NC)"
@echo "$(GREEN)All scripts passed syntax check!$(NC)"
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Complete removal when you no longer need LazyVim Docker:
lazy uninstall

# Or run directly
curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scripts/remote-uninstall.sh | bash
curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scripts/uninstall.sh | bash
```

**Removes everything**: Docker containers, installation files, global commands, and shell configurations in one step.
Expand Down Expand Up @@ -113,14 +113,14 @@ curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scrip
- ✅ Creates shell configuration backups

### 🔄 Update Script
**`remote-update.sh`** - Keep your installation up to date
**Smart Update System** - Keep your installation up to date

```bash
# Update to latest version
# Update to latest version (recommended)
lazy update

# Or run directly
curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scripts/remote-update.sh | bash
# Or from project directory
make update
```

**What it does:**
Expand All @@ -132,14 +132,14 @@ curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scrip
- ✅ Optionally rebuilds Docker containers

### 🗑️ Uninstallation Script
**`remote-uninstall.sh`** - Complete and safe cleanup
**Smart Uninstaller** - Complete and safe cleanup

```bash
# Interactive uninstall with confirmation prompt
lazy uninstall

# Or run directly with prompts
curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scripts/remote-uninstall.sh | bash
curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scripts/uninstall.sh | bash
```

**What it does when you confirm:**
Expand Down Expand Up @@ -184,15 +184,17 @@ curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scrip
- Creates `~/.local/bin/lazy`
- Creates `~/.local/share/lazyvim-docker/`

### 🔄 remote-update.sh
**Purpose**: Update existing remote installation to latest version
### 🔄 Smart Update System
**Purpose**: Update existing installation to latest version with intelligent version checking

**Update Process:**
1. Checks current version vs latest GitHub release
2. Creates backup of current installation
3. Downloads latest version to temp directory
4. Preserves user configurations (.dotfiles, backups)
5. Replaces system files while keeping user data
2. Compares local and remote git commits
3. Interactive prompts for user confirmation
4. Creates backup of current installation
5. Downloads latest version preserving development setup
6. Preserves user configurations (.dotfiles, backups)
7. Offers container rebuild options
6. Optionally rebuilds Docker containers
7. Cleans up temporary files

Expand All @@ -204,7 +206,7 @@ curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scrip
**Safe Rollback:**
- Backup created before update in `~/.local/share/lazyvim-docker-backup-[timestamp]`

### 🗑️ remote-uninstall.sh
### 🗑️ Smart Uninstaller
**Purpose**: Complete and safe removal of LazyVim Docker installation

**Removal Process:**
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.3
1.3.4
120 changes: 74 additions & 46 deletions scripts/install-global-commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,34 +79,41 @@ $marker_start
# Use 'lazy <command>' from anywhere to control LazyVim Docker
lazyvim_docker_path="$LAZYVIM_DOCKER_PATH"

# Colors for lazy command output
LAZY_RED='\033[0;31m'
LAZY_GREEN='\033[0;32m'
LAZY_YELLOW='\033[1;33m'
LAZY_BLUE='\033[0;34m'
LAZY_NC='\033[0m' # No Color

lazy() {
if [[ \$# -eq 0 ]]; then
printf "LazyVim Docker - Available Commands\n"
printf "\${LAZY_BLUE}LazyVim Docker - Available Commands\${LAZY_NC}\n"
printf "\n"
printf "Usage: lazy <command>\n"
printf "\n"
printf "Available commands:\n"
printf " start Start the container\n"
printf " enter Enter the container (starts if stopped)\n"
printf " stop Stop the container\n"
printf " status Show container status\n"
printf " health Run health diagnostics\n"
printf " build Build/rebuild the container\n"
printf " restart Restart the container\n"
printf " destroy Destroy everything\n"
printf " clean Clean up Docker resources\n"
printf " quick Quick start (build + enter)\n"
printf " backup Backup configurations\n"
printf " restore Restore from backup\n"
printf " update Update to latest version\n"
printf " version Show version\n"
printf " timezone Check timezone configuration\n"
printf " configure Reconfigure directories and timezone\n"
printf " uninstall Complete removal (same as curl method)\n"
printf " \${LAZY_GREEN}start\${LAZY_NC} Start the container\n"
printf " \${LAZY_GREEN}enter\${LAZY_NC} Enter the container (starts if stopped)\n"
printf " \${LAZY_GREEN}stop\${LAZY_NC} Stop the container\n"
printf " \${LAZY_GREEN}status\${LAZY_NC} Show container status\n"
printf " \${LAZY_GREEN}health\${LAZY_NC} Run health diagnostics\n"
printf " \${LAZY_GREEN}build\${LAZY_NC} Build/rebuild the container\n"
printf " \${LAZY_GREEN}restart\${LAZY_NC} Restart the container\n"
printf " \${LAZY_GREEN}destroy\${LAZY_NC} Destroy everything\n"
printf " \${LAZY_GREEN}clean\${LAZY_NC} Clean up Docker resources\n"
printf " \${LAZY_GREEN}quick\${LAZY_NC} Quick start (build + enter)\n"
printf " \${LAZY_GREEN}backup\${LAZY_NC} Backup configurations\n"
printf " \${LAZY_GREEN}restore\${LAZY_NC} Restore from backup\n"
printf " \${LAZY_GREEN}update\${LAZY_NC} Update to latest version\n"
printf " \${LAZY_GREEN}version\${LAZY_NC} Show version\n"
printf " \${LAZY_GREEN}timezone\${LAZY_NC} Check timezone configuration\n"
printf " \${LAZY_GREEN}configure\${LAZY_NC} Reconfigure directories and timezone\n"
printf " \${LAZY_GREEN}uninstall\${LAZY_NC} Complete removal (same as curl method)\n"
printf "\n"
printf "Examples:\n"
printf " lazy enter # Enter LazyVim from anywhere\n"
printf " lazy build # Build the environment\n"
printf "\${LAZY_YELLOW}Examples:\${LAZY_NC}\n"
printf " \${LAZY_GREEN}lazy enter\${LAZY_NC} # Enter LazyVim from anywhere\n"
printf " \${LAZY_GREEN}lazy build\${LAZY_NC} # Build the environment\n"
return 0
fi

Expand All @@ -116,11 +123,18 @@ lazy() {
case "\$cmd" in
start|enter|stop|status|health|build|restart|destroy|clean|quick|backup|restore|update|version|timezone|configure)
printf "🚀 Running: make %s %s\n" "\$cmd" "\$@"
(cd "\$lazyvim_docker_path" && make "\$cmd" "\$@")
# Preserve TTY for interactive commands by not using subshell
local current_dir=\$(pwd)
cd "\$lazyvim_docker_path"
make "\$cmd" "\$@"
cd "\$current_dir"
;;
uninstall)
printf "🗑️ Running complete uninstaller...\n"
(cd "\$lazyvim_docker_path" && ./scripts/remote-uninstall.sh)
local current_dir=\$(pwd)
cd "\$lazyvim_docker_path"
./scripts/uninstall.sh
cd "\$current_dir"
;;
*)
printf "❌ Unknown command: %s\n" "\$cmd"
Expand Down Expand Up @@ -169,34 +183,41 @@ $marker_start
# Use 'lazy <command>' from anywhere to control LazyVim Docker
lazyvim_docker_path="$LAZYVIM_DOCKER_PATH"

# Colors for lazy command output
LAZY_RED='\033[0;31m'
LAZY_GREEN='\033[0;32m'
LAZY_YELLOW='\033[1;33m'
LAZY_BLUE='\033[0;34m'
LAZY_NC='\033[0m' # No Color

lazy() {
if [[ \$# -eq 0 ]]; then
printf "LazyVim Docker - Available Commands\n"
printf "\${LAZY_BLUE}LazyVim Docker - Available Commands\${LAZY_NC}\n"
printf "\n"
printf "Usage: lazy <command>\n"
printf "\n"
printf "Available commands:\n"
printf " start Start the container\n"
printf " enter Enter the container (starts if stopped)\n"
printf " stop Stop the container\n"
printf " status Show container status\n"
printf " health Run health diagnostics\n"
printf " build Build/rebuild the container\n"
printf " restart Restart the container\n"
printf " destroy Destroy everything\n"
printf " clean Clean up Docker resources\n"
printf " quick Quick start (build + enter)\n"
printf " backup Backup configurations\n"
printf " restore Restore from backup\n"
printf " update Update to latest version\n"
printf " version Show version\n"
printf " timezone Check timezone configuration\n"
printf " configure Reconfigure directories and timezone\n"
printf " uninstall Complete removal (same as curl method)\n"
printf " \${LAZY_GREEN}start\${LAZY_NC} Start the container\n"
printf " \${LAZY_GREEN}enter\${LAZY_NC} Enter the container (starts if stopped)\n"
printf " \${LAZY_GREEN}stop\${LAZY_NC} Stop the container\n"
printf " \${LAZY_GREEN}status\${LAZY_NC} Show container status\n"
printf " \${LAZY_GREEN}health\${LAZY_NC} Run health diagnostics\n"
printf " \${LAZY_GREEN}build\${LAZY_NC} Build/rebuild the container\n"
printf " \${LAZY_GREEN}restart\${LAZY_NC} Restart the container\n"
printf " \${LAZY_GREEN}destroy\${LAZY_NC} Destroy everything\n"
printf " \${LAZY_GREEN}clean\${LAZY_NC} Clean up Docker resources\n"
printf " \${LAZY_GREEN}quick\${LAZY_NC} Quick start (build + enter)\n"
printf " \${LAZY_GREEN}backup\${LAZY_NC} Backup configurations\n"
printf " \${LAZY_GREEN}restore\${LAZY_NC} Restore from backup\n"
printf " \${LAZY_GREEN}update\${LAZY_NC} Update to latest version\n"
printf " \${LAZY_GREEN}version\${LAZY_NC} Show version\n"
printf " \${LAZY_GREEN}timezone\${LAZY_NC} Check timezone configuration\n"
printf " \${LAZY_GREEN}configure\${LAZY_NC} Reconfigure directories and timezone\n"
printf " \${LAZY_GREEN}uninstall\${LAZY_NC} Complete removal (same as curl method)\n"
printf "\n"
printf "Examples:\n"
printf " lazy enter # Enter LazyVim from anywhere\n"
printf " lazy build # Build the environment\n"
printf "\${LAZY_YELLOW}Examples:\${LAZY_NC}\n"
printf " \${LAZY_GREEN}lazy enter\${LAZY_NC} # Enter LazyVim from anywhere\n"
printf " \${LAZY_GREEN}lazy build\${LAZY_NC} # Build the environment\n"
return 0
fi

Expand All @@ -206,11 +227,18 @@ lazy() {
case "\$cmd" in
start|enter|stop|status|health|build|restart|destroy|clean|quick|backup|restore|update|version|timezone|configure)
printf "🚀 Running: make %s %s\n" "\$cmd" "\$@"
(cd "\$lazyvim_docker_path" && make "\$cmd" "\$@")
# Preserve TTY for interactive commands by not using subshell
local current_dir=\$(pwd)
cd "\$lazyvim_docker_path"
make "\$cmd" "\$@"
cd "\$current_dir"
;;
uninstall)
printf "🗑️ Running complete uninstaller...\n"
(cd "\$lazyvim_docker_path" && ./scripts/remote-uninstall.sh)
local current_dir=\$(pwd)
cd "\$lazyvim_docker_path"
./scripts/uninstall.sh
cd "\$current_dir"
;;
*)
printf "❌ Unknown command: %s\n" "\$cmd"
Expand Down
Loading