Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
4b05a94
feat: implement global command installation and uninstallation scripts
manghidev Jul 1, 2025
4c2a65d
feat: add global commands installer and interactive configuration tests
manghidev Jul 1, 2025
60e16ac
fix: ensure interactive prompts read from the correct terminal
manghidev Jul 1, 2025
064ddb0
feat: enhance remote installation script with non-interactive mode su…
manghidev Jul 1, 2025
e41a2c0
fix: update sed commands in timezone configuration to use pipe delimi…
manghidev Jul 1, 2025
e02a858
feat: improve prompt consistency in interactive scripts and add test …
manghidev Jul 1, 2025
0c6c901
refactor: remove obsolete test scripts for interactive prompts and se…
manghidev Jul 1, 2025
fa67057
refactor: refactor installation scripts: replace remote-install.sh wi…
manghidev Jul 2, 2025
6b75691
feat: add shell detection and terminal restart functionality to insta…
manghidev Jul 2, 2025
510d48b
feat: enhance terminal restart functionality with user-friendly optio…
manghidev Jul 2, 2025
135f6a2
feat: enhance configure.sh with improved directory management and use…
manghidev Jul 2, 2025
24c41d3
feat: add LazyVim Docker configuration and enhance scripts
manghidev Jul 2, 2025
5d9fa7a
refactor: remove debug_mounts.sh and test_mounts.sh scripts to stream…
manghidev Jul 2, 2025
c213c2f
refactor: remove LazyVim Docker configuration file to streamline code…
manghidev Jul 2, 2025
11a90c3
fix: improve user prompts and output formatting in uninstall and upda…
manghidev Jul 2, 2025
52de7fa
feat: enhance remote uninstall script with interactive prompts and fo…
manghidev Jul 3, 2025
e0f99ed
refactor: streamline uninstallation script by removing interactive pr…
manghidev Jul 3, 2025
ad3fdba
docs: enhance uninstallation section with detailed instructions and s…
manghidev Jul 3, 2025
f6f75c8
fix: enhance existence checks for mounted directories and provide hel…
manghidev Jul 3, 2025
bde31dd
fix: remove redundant force uninstall instructions from README and cl…
manghidev Jul 3, 2025
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
.dotfiles/.zcompdump-*
.dotfiles/.zsh_history

# LazyVim Docker configuration
.lazyvim-docker-config

# Backup files
backups/
*.backup
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -172,19 +172,19 @@ install-remote:
@echo "$(BLUE)LazyVim Docker - Remote Installation$(NC)"
@echo ""
@echo "To install LazyVim Docker remotely (recommended):"
@echo "$(GREEN)curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scripts/remote-install.sh | bash$(NC)"
@echo "$(GREEN)curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scripts/start.sh | bash$(NC)"
@echo ""
@echo "This will:"
@echo " • Download and install LazyVim Docker to ~/.local/share/lazyvim-docker"
@echo " • Create global 'lazy' command"
@echo " • Build Docker environment"
@echo " • Build Docker environment with smart defaults"
@echo " • No repository cloning required - everything is automated"

remote-install: install-remote

test-remote-scripts:
@echo "$(BLUE)Testing remote installation scripts...$(NC)"
@bash -n scripts/remote-install.sh && echo "$(GREEN)✓ remote-install.sh syntax OK$(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)"
106 changes: 64 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ A professional Dockerized environment for LazyVim (advanced Neovim configuration
## 🚀 Quick Start

### 🌐 Remote Installation (Recommended)
Install directly without cloning the repository - no manual setup needed:
Install directly without cloning the repository - automatic setup with smart defaults:

```bash
# One-line installation
curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scripts/remote-install.sh | bash
# One-line installation with automatic configuration
curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scripts/start.sh | bash

# Then use from anywhere
lazy enter # Enter LazyVim development environment
lazy configure # Customize your setup (optional)
```

### 📦 Traditional Installation
Expand All @@ -31,6 +32,19 @@ make build # Build the environment
make enter # Enter the container
```

### 🗑️ Uninstallation
Complete removal when you no longer need LazyVim Docker:

```bash
# Interactive uninstall (asks for confirmation)
lazy uninstall

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

**Removes everything**: Docker containers, installation files, global commands, and shell configurations in one step.

---

## ✨ Features
Expand Down Expand Up @@ -83,11 +97,11 @@ make destroy # ⚠️ DANGEROUS: Removes everything
LazyVim Docker provides three main remote scripts for easy management:

### 📥 Installation Script
**`remote-install.sh`** - Complete setup in one command
**`start.sh`** - Automatic setup with smart defaults

```bash
# Full installation with Docker build
curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scripts/remote-install.sh | bash
# Full installation with automatic configuration
curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scripts/start.sh | bash
```

**What it does:**
Expand All @@ -96,6 +110,7 @@ curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scrip
- ✅ Creates global `lazy` command in `~/.local/bin`
- ✅ Adds `~/.local/bin` to your PATH automatically
- ✅ Builds Docker environment (may take a few minutes)
- ✅ Uses smart defaults for timezone and directories
- ✅ Creates shell configuration backups

### 🔄 Update Script
Expand All @@ -118,30 +133,37 @@ curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scrip
- ✅ Optionally rebuilds Docker containers

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

```bash
# Uninstall everything with prompts
# Interactive uninstall with confirmation prompt
lazy uninstall

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

**What it does:**
- ✅ Stops and removes Docker containers/images
- ✅ Removes installation directory (`~/.local/share/lazyvim-docker`)
**What it does when you confirm:**
- ✅ Stops and removes all Docker containers and images
- ✅ Removes installation directory (`~/.local/share/lazyvim-docker`)
- ✅ Removes global `lazy` command
- ✅ Optionally cleans PATH modifications from shell configs
- ✅ Creates backups before making changes
- ✅ Interactive prompts for safety
- ✅ Removes shell configuration entries (`.zshrc`, `.bashrc`, etc.)
- ✅ Removes PATH modifications automatically
- ✅ Creates timestamped backups before making changes
- ✅ **Everything is removed in one confirmation** - no additional prompts

**Safety Features:**
- 🛡️ **Interactive confirmation** - Shows exactly what will be removed
- 🛡️ **Non-interactive safety** - Cancels by default when piped unless forced
- 🛡️ **Automatic backups** - Creates backups of modified configuration files
- 🛡️ **Clear messaging** - Shows progress and results of each step

---

## 🔬 Script Details & Technical Info

### 📥 remote-install.sh
**Purpose**: Complete LazyVim Docker setup without repository cloning
### 📥 start.sh
**Purpose**: Complete LazyVim Docker setup with automatic configuration

**Requirements Check:**
- Docker (with compose support)
Expand Down Expand Up @@ -184,26 +206,27 @@ curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scrip
- Backup created before update in `~/.local/share/lazyvim-docker-backup-[timestamp]`

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

**Removal Process:**
1. Stops all running containers
2. Removes Docker containers and images
3. Removes Docker volumes
4. Removes installation directory
5. Removes global `lazy` command
6. Optionally cleans PATH from shell configs
7. Creates backups before deletion

**Interactive Prompts:**
- Confirm complete uninstall
- Choose to remove PATH modifications
- Option to keep or remove project files

**Cleanup Scope:**
- Docker: containers, images, volumes
- Files: installation directory, global command
- Config: PATH modifications (optional)
1. Shows exactly what will be removed
2. **Single confirmation prompt** - no additional questions
3. Stops all running containers
4. Removes Docker containers, images, and volumes
5. Removes installation directory (`~/.local/share/lazyvim-docker`)
6. Removes global `lazy` command and shell integrations
7. Removes PATH modifications automatically
8. Creates timestamped backups before any changes

**Smart Detection:**
- **Interactive mode**: Shows confirmation prompt when run manually
- **Automatic backup**: Creates `.backup.[timestamp]` files before modifying shell configs

**Complete Cleanup:**
- ✅ Docker: containers, images, volumes
- ✅ Files: installation directory, global command
- ✅ Config: shell entries and PATH modifications
- ✅ **Everything removed in one confirmation** - streamlined process

---

Expand All @@ -220,7 +243,7 @@ curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scrip
```bash
# From your existing repo directory
make destroy && cd .. && rm -rf lazyvim-docker
curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scripts/remote-install.sh | bash
curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scripts/start.sh | bash
```

**From Remote to Traditional:**
Expand All @@ -235,8 +258,8 @@ git clone https://github.com/manghidev/lazyvim-docker.git && cd lazyvim-docker &

### Remote Installation Workflow (Recommended)
```bash
# 1. Install once (5-10 minutes)
curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scripts/remote-install.sh | bash
# 1. Install once (5-10 minutes) - automatic setup
curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scripts/start.sh | bash

# 2. Daily usage from anywhere
cd ~/Projects/my-project
Expand All @@ -245,6 +268,7 @@ lazy enter # Start coding immediately
# 3. Management commands
lazy status # Check if running
lazy stop # Stop when done
lazy configure # Customize setup (optional)
lazy update # Update weekly/monthly
```

Expand All @@ -265,8 +289,6 @@ For detailed workflow and troubleshooting: **[📖 Container Lifecycle Guide](do

---

## 🔧 Advanced Configuration

## 🔧 Configuration

### 🎯 Easy Configuration (Recommended)
Expand Down Expand Up @@ -364,8 +386,8 @@ lazy build
# Update to fix issues
lazy update

# Nuclear option
lazy uninstall && curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scripts/remote-install.sh | bash
# Nuclear option - complete reinstall
lazy uninstall && curl -fsSL https://raw.githubusercontent.com/manghidev/lazyvim-docker/main/scripts/start.sh | bash
```

---
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.0
1.3.1
8 changes: 4 additions & 4 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ DOTFILES_DIR=".dotfiles"

# Functions
log_info() {
echo -e "${BLUE}[INFO]${NC} $1"
printf "${BLUE}[INFO]${NC} %s\n" "$1"
}

log_success() {
echo -e "${GREEN}[SUCCESS]${NC} $1"
printf "${GREEN}[SUCCESS]${NC} %s\n" "$1"
}

log_warning() {
echo -e "${YELLOW}[WARNING]${NC} $1"
printf "${YELLOW}[WARNING]${NC} %s\n" "$1"
}

log_error() {
echo -e "${RED}[ERROR]${NC} $1"
printf "${RED}[ERROR]${NC} %s\n" "$1"
}

# Check if VERSION file exists
Expand Down
12 changes: 6 additions & 6 deletions scripts/bump-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ NC='\033[0m'

# Validate bump type
if [[ ! "$BUMP_TYPE" =~ ^(patch|minor|major)$ ]]; then
echo -e "${RED}Error: Invalid bump type. Use: patch, minor, or major${NC}"
printf "${RED}Error: Invalid bump type. Use: patch, minor, or major${NC}\n"
exit 1
fi

# Read current version
if [[ ! -f "$VERSION_FILE" ]]; then
echo -e "${RED}Error: VERSION file not found${NC}"
printf "${RED}Error: VERSION file not found${NC}\n"
exit 1
fi

CURRENT_VERSION=$(cat "$VERSION_FILE")
echo -e "${BLUE}Current version: $CURRENT_VERSION${NC}"
printf "${BLUE}Current version: $CURRENT_VERSION${NC}\n"

# Parse version components
IFS='.' read -ra VERSION_PARTS <<< "$CURRENT_VERSION"
Expand Down Expand Up @@ -56,13 +56,13 @@ NEW_VERSION="$MAJOR.$MINOR.$PATCH"

# Write new version
echo "$NEW_VERSION" > "$VERSION_FILE"
echo -e "${GREEN}Version bumped to: $NEW_VERSION${NC}"
printf "${GREEN}Version bumped to: $NEW_VERSION${NC}\n"

# Git commit if in a git repository
if git rev-parse --git-dir > /dev/null 2>&1; then
echo -e "${YELLOW}Committing version bump...${NC}"
printf "${YELLOW}Committing version bump...${NC}\n"
git add "$VERSION_FILE"
git commit -m "Bump version to $NEW_VERSION"
git tag "v$NEW_VERSION"
echo -e "${GREEN}Version committed and tagged${NC}"
printf "${GREEN}Version committed and tagged${NC}\n"
fi
28 changes: 14 additions & 14 deletions scripts/check-timezone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ NC='\033[0m'

CONTAINER_NAME="lazyvim"

echo -e "${BLUE}Checking timezone configuration...${NC}"
echo ""
printf "${BLUE}Checking timezone configuration...${NC}\n"
printf "\n"

if docker ps | grep -q "$CONTAINER_NAME"; then
echo -e "${GREEN}Container timezone information:${NC}"
echo "Current time in container:"
printf "${GREEN}Container timezone information:${NC}\n"
printf "Current time in container:\n"
docker exec "$CONTAINER_NAME" date
echo ""
echo "Timezone file:"
docker exec "$CONTAINER_NAME" cat /etc/timezone 2>/dev/null || echo "Timezone file not found"
echo ""
echo "TZ environment variable:"
docker exec "$CONTAINER_NAME" env | grep TZ || echo "TZ variable not set"
echo ""
echo -e "${GREEN}Local system time for comparison:${NC}"
printf "\n"
printf "Timezone file:\n"
docker exec "$CONTAINER_NAME" cat /etc/timezone 2>/dev/null || printf "Timezone file not found\n"
printf "\n"
printf "TZ environment variable:\n"
docker exec "$CONTAINER_NAME" env | grep TZ || printf "TZ variable not set\n"
printf "\n"
printf "${GREEN}Local system time for comparison:${NC}\n"
date
else
echo "Container '$CONTAINER_NAME' is not running."
echo "Please start the container first with: make start"
printf "Container '%s' is not running.\n" "$CONTAINER_NAME"
printf "Please start the container first with: make start\n"
exit 1
fi
Loading