nushell-plugins/scripts/sh/update_nushell.sh

37 lines
839 B
Bash
Raw Normal View History

#!/bin/bash
# Update Nushell Submodule Script
# Updates the nushell submodule to the latest version
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
NUSHELL_DIR="$SCRIPT_DIR/nushell"
if [ ! -d "$NUSHELL_DIR/.git" ]; then
echo "❌ Nushell submodule not initialized"
echo "Run: git submodule init && git submodule update"
exit 1
fi
case "${1:-}" in
update)
echo "🔄 Updating nushell submodule..."
cd "$NUSHELL_DIR"
git fetch origin
git checkout main
git pull origin main
cd "$SCRIPT_DIR"
echo "✅ Nushell submodule updated"
;;
check)
echo "🔍 Checking nushell submodule status..."
cd "$NUSHELL_DIR"
git status
;;
*)
echo "Usage: $0 {update|check}"
exit 1
;;
esac