Skip to content

Instantly share code, notes, and snippets.

@attilam
Last active February 16, 2017 06:34
Show Gist options
  • Save attilam/87dc7f613adecb49cbf335792eea9ce4 to your computer and use it in GitHub Desktop.
Save attilam/87dc7f613adecb49cbf335792eea9ce4 to your computer and use it in GitHub Desktop.
Upload file to shared folder on site (replacing spaces with _ in filename), copy URL to clipboard, display notification.
#!/usr/bin/env bash
fname=$(basename -a -s $1)
underscore=${fname//[[:space:]]/_}
targetname="http://attilam.com/shared/$underscore"
curl -s -n -T "$1" ftp://attilam.com/public_html/shared/$underscore
echo -n $targetname | pbcopy
osascript -e "display notification \"$targetname\" with title \"File uploaded.\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment