convert-dirs/bin/install.sh

22 lines
536 B
Bash
Executable file

#!/bin/bash
set -euo pipefail
ROOT_SRC=".."
ROOT_DST="/usr/local"
SCRIPT_NAME="$ROOT_SRC/convert_dirs.sh"
INSTALL_DIR="$ROOT_DST/bin"
TARGET_NAME="convert_dirs"
# Check script exists
if [[ ! -f "$SCRIPT_NAME" ]]; then
echo "❌ Error: $SCRIPT_NAME not found in current directory." >&2
exit 1
fi
# Copy to install location
echo "📦 Installing $SCRIPT_NAME to $INSTALL_DIR/$TARGET_NAME ..."
sudo install -m 755 "$SCRIPT_NAME" "$INSTALL_DIR/$TARGET_NAME"
echo "✅ Installed successfully."
echo "🔧 Run it with: $TARGET_NAME"