- Implement nomarchy-version, nomarchy-debug, nomarchy-reinstall, nomarchy-rollback, nomarchy-upload-log - Implement nomarchy-refresh-hyprland and nomarchy-refresh-waybar - Update docs/SCRIPTS.md with 'kept' status for new scripts
26 lines
526 B
Bash
Executable File
26 lines
526 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Nomarchy Log Upload Script
|
|
# Uploads stdin or a file to a pastebin service.
|
|
|
|
set -e
|
|
|
|
if [[ -t 0 ]] && [[ -z $1 ]]; then
|
|
echo "Usage: some-command | nomarchy-upload-log"
|
|
echo " nomarchy-upload-log <file>"
|
|
exit 1
|
|
fi
|
|
|
|
# Use ix.io as the default pastebin
|
|
if [[ -n $1 ]]; then
|
|
url=$(curl -F "f:1=@$1" ix.io)
|
|
else
|
|
url=$(curl -F "f:1=@-" ix.io)
|
|
fi
|
|
|
|
echo "Log uploaded to: $url"
|
|
if command -v wl-copy &>/dev/null; then
|
|
echo "$url" | wl-copy
|
|
echo "Link copied to clipboard."
|
|
fi
|