Update to omarchy-nvim
This commit is contained in:
1 parent
38272ba428
commit
a867a290c6
9 files changed
+115
-17
No files matched your search
Executable
+53
@@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
# Setup script for omarchy-nvim
|
||||
# This can be called from Omarchy setup scripts
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
PACKAGE_DIR="/usr/share/omarchy-nvim"
|
||||
CONFIG_DIR="${HOME}/.config/nvim"
|
||||
DATA_DIR="${HOME}/.local/share/nvim"
|
||||
STATE_DIR="${HOME}/.local/state/nvim"
|
||||
CACHE_DIR="${HOME}/.cache/nvim"
|
||||
|
||||
# Check if package is installed
|
||||
if [[ ! -d "$PACKAGE_DIR" ]]; then
|
||||
echo "Error: omarchy-nvim package not installed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if nvim config already exists
|
||||
if [[ -d "$CONFIG_DIR" ]]; then
|
||||
if gum confirm "Neovim configuration already exists at $CONFIG_DIR. This will overwrite it. Continue?"; then
|
||||
# Backup existing config
|
||||
BACKUP_DIR="${CONFIG_DIR}.backup.$(date +%Y%m%d-%H%M%S)"
|
||||
echo "Backing up existing config to $BACKUP_DIR"
|
||||
mv "$CONFIG_DIR" "$BACKUP_DIR"
|
||||
else
|
||||
echo "Setup cancelled."
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Setting up Neovim configuration..."
|
||||
|
||||
# Make sure everything is clear
|
||||
rm -rf $DATA_DIR $CACHE_DIR $STATE_DIR
|
||||
|
||||
# Create directories if needed
|
||||
mkdir -p "$(dirname "$CONFIG_DIR")"
|
||||
mkdir -p "$(dirname "$DATA_DIR")"
|
||||
mkdir -p "$(dirname "$CACHE_DIR")"
|
||||
|
||||
# Copy files
|
||||
cp -r "$PACKAGE_DIR/config" "$CONFIG_DIR"
|
||||
cp -r "$PACKAGE_DIR/data" "$DATA_DIR"
|
||||
cp -r "$PACKAGE_DIR/cache" "$CACHE_DIR"
|
||||
|
||||
for dir in $DATA_DIR/lazy/*/; do
|
||||
if [ -d "$dir/.git" ]; then
|
||||
git --git-dir="$dir/.git" --work-tree="$dir" restore .
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Neovim setup complete!"
|
||||
Reference in new issue
Block a user