Skip to content

Instantly share code, notes, and snippets.

@geoffyuen
Last active December 28, 2015 22:09
Show Gist options
  • Save geoffyuen/7570048 to your computer and use it in GitHub Desktop.
Save geoffyuen/7570048 to your computer and use it in GitHub Desktop.
bash script / OSX .command menu to use git ftp. Requirements: - GIT - GIT FTP - a GIT repro Put this in the folder you're working in and chmod 777 it.
#!/bin/bash
cd "$(dirname "$0")"
clear
echo "GIT FTP Menu (ctrl-c to abort)"
echo
PS3='Please enter your choice: '
options=("Commit" "Mock Upload" "Configure" "First Time Commit" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Commit")
echo "Commiting..."
git ftp push
;;
"Mock Upload")
echo "This is a test..."
git ftp push -D
;;
"Configure")
echo "FTP username:"
read input_variable
git config git-ftp.user $input_variable
echo "FTP password:"
read input_variable
git config git-ftp.password $input_variable
echo "FTP full url path (ftp://google.com/thisfolder/overhere):"
read input_variable
git config git-ftp.url $input_variable
echo "You're ready to do your first time commit"
read input_variable
;;
"First Time Commit")
echo "First time upload..."
git ftp init
;;
"Quit")
echo "You can close or quit this window"
break
;;
*) echo invalid option;;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment