- Add directory information with Unicode table borders - Add network information with professional formatting - Add version command - Add comprehensive documentation (README.md, DEVELOPMENT.md) - Improve table output with proper borders and alignment - Add project structure (cmd/, pkg/ directories)
44 lines
1.2 KiB
Bash
Executable file
44 lines
1.2 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
# zutils Installation Script
|
|
|
|
set -e
|
|
|
|
echo "Installing zutils..."
|
|
|
|
# Build the binary
|
|
echo "Building zutils binary..."
|
|
go build -o zutils
|
|
|
|
# Determine installation directory
|
|
if [ -w "/usr/local/bin" ]; then
|
|
INSTALL_DIR="/usr/local/bin"
|
|
elif [ -w "$HOME/.local/bin" ]; then
|
|
INSTALL_DIR="$HOME/.local/bin"
|
|
# Create the directory if it doesn't exist
|
|
mkdir -p "$INSTALL_DIR"
|
|
else
|
|
echo "Error: Cannot write to /usr/local/bin or ~/.local/bin"
|
|
echo "Please run with sudo or install manually:"
|
|
echo " sudo cp zutils /usr/local/bin/"
|
|
exit 1
|
|
fi
|
|
|
|
# Copy the binary
|
|
echo "Installing to $INSTALL_DIR..."
|
|
cp zutils "$INSTALL_DIR/zutils"
|
|
chmod +x "$INSTALL_DIR/zutils"
|
|
|
|
# Create symlink for 'z' shortcut
|
|
echo "Creating 'z' shortcut..."
|
|
ln -sf "$INSTALL_DIR/zutils" "$INSTALL_DIR/z"
|
|
|
|
echo "✅ zutils installed successfully!"
|
|
echo ""
|
|
echo "You can now use both 'zutils' and 'z' commands from anywhere."
|
|
echo ""
|
|
echo "Try it out:"
|
|
echo " z info README.md # File information"
|
|
echo " z info . # Directory information"
|
|
echo " z info network # Network information"
|
|
echo " z main.go # Auto-detect file info"
|