Skip to content

Instantly share code, notes, and snippets.

@c3ph3us
Forked from RichardBronosky/imgist.sh
Created August 17, 2023 15:07
Show Gist options
  • Save c3ph3us/060711535f10af787d754a16cc4d1eb5 to your computer and use it in GitHub Desktop.
Save c3ph3us/060711535f10af787d754a16cc4d1eb5 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