Skip to content

Instantly share code, notes, and snippets.

@RichardBronosky
Last active August 17, 2023 15:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save RichardBronosky/89fe9b680e72242621c75f4cfcf356ef to your computer and use it in GitHub Desktop.
Save RichardBronosky/89fe9b680e72242621c75f4cfcf356ef to your computer and use it in GitHub Desktop.
Imgur was down, so I created Imgist
#! /usr/bin/env bash
set -eu
_main(){
input_file="$1"
file_path="$(realpath -s "$input_file")"
file_name="$(basename "$file_path")"
cd "$(dirname "$(realpath -s "${BASH_SOURCE[0]}")")"
cp "$file_path" ./
git add "$file_name"
git commit -m "Add '$file_name'"
git push
}
_main "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment