add:send func

This commit is contained in:
2026-04-06 02:57:22 +09:00
parent 2760826b26
commit 5e44a3a35c
8 changed files with 342 additions and 11 deletions

47
build.sh Normal file
View File

@@ -0,0 +1,47 @@
#!/usr/bin/env bash
#!/usr/bin/env bash
set -e
LOCAL_BIN="$HOME/.local/bin"
EXPORT_LINE='export PATH="$HOME/.local/bin:$PATH"'
# Files to check (macOS + Linux)
FILES=(
"$HOME/.bashrc"
"$HOME/.bash_profile"
"$HOME/.zshrc"
)
echo "Ensuring ~/.local/bin exists..."
mkdir -p "$LOCAL_BIN"
add_to_file() {
local file="$1"
# Create file if it doesn't exist
[ -f "$file" ] || touch "$file"
if grep -qxF "$EXPORT_LINE" "$file"; then
echo "✓ PATH already set in $(basename "$file")"
else
echo "→ Adding PATH to $(basename "$file")"
{
echo ""
echo "# Add local bin to PATH"
echo "$EXPORT_LINE"
} >> "$file"
fi
}
echo "Updating shell config files..."
for file in "${FILES[@]}"; do
add_to_file "$file"
done
echo ""
echo "Done!"
echo "Restart your shell or run:"
echo " source ~/.zshrc # for zsh"
echo " source ~/.bashrc # for bash"