diff --git a/gp/gp b/gp/gp new file mode 100755 index 0000000..b68f73b --- /dev/null +++ b/gp/gp @@ -0,0 +1,18 @@ +#!/bin/bash + +# find top folder of the git repo from current directory + +MYDIR=$(git rev-parse --show-toplevel) + +if [ -z "$MYDIR" ]; then + echo "Not in a git repository" + exit 1 +fi + +# do a git diff, and use AI to determine a good commit message. + +# add all changes at $MYDIR level, commit with the message from AI, and push to origin. + +git add . +git commit -m "$(git diff --name-only | xargs -I{} sh -c 'echo "{}: "; git diff --color=always {} | head -n 1')" +git push origin main diff --git a/gp/publish.sh b/gp/publish.sh new file mode 100755 index 0000000..9333942 --- /dev/null +++ b/gp/publish.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -euo pipefail + +#set projec to the folder this script is in. +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +PROJECT=$(basename "$SCRIPT_DIR") +SOS_DIR="${SCRIPT_DIR}/../sos" + +# run sos to upload sos +"${SOS_DIR}/sos" upload "getbin.xyz" "${SCRIPT_DIR}/${PROJECT}" "${PROJECT}:latest"