#!/usr/bin/env bash | |
# author: Thomas Aylott SubtleGradient.com | |
echo "Transmitting" | |
for i in `git log -${1:-1} $2 --name-only|grep -E '^[^ ]+$'|sort|uniq`; do | |
if [[ -e $i ]]; then | |
echo " $i" | |
open -a Transmit $i | |
fi | |
done |
This comment has been minimized.
This comment has been minimized.
I'm sure there's a better way to do this than to parse the git log, but this works well enough for me sofar. |
This comment has been minimized.
This comment has been minimized.
Lovely! Is there any way to make Transmit pick the correct Favourite? It just seems to open up the same favourite without asking (and putting my files live NOT staged :S ) |
This comment has been minimized.
This comment has been minimized.
I have no idea. Sorry :[ Well, I guess you setup DockSend only on one favorite and not the other. |
This comment has been minimized.
This comment has been minimized.
Just had an idea! What if you export 2 droplets with all the FTP details in it... eg, Then type, or sh git-transmit 1 --since=yesterday staging Then it calls the correct droplet app, (afraid I don't know shell scripting to make it run an if statement) or open -a ftp-staging.app $i |
This comment has been minimized.
This comment has been minimized.
That just might work.
Let me know how it works out.
I recently learned bash if syntax. It's a very handy skill, I highly recommend the investment in time it takes to learn it.
— Thomas Aylott - SubtleGradient - MooTools - Facebook (from iPhone)
…On Mar 2, 2012, at 9:46 AM, ***@***.*** wrote:
Just had an idea!
What if you export 2 droplets with all the FTP details in it... eg,
ftp-live.app
ftp-staging.app
Then type,
sh git-transmit 1 --since=yesterday live
or
sh git-transmit 1 --since=yesterday staging
Then it calls the correct droplet app, (afraid I don't know shell scripting to make it run an if statement)
open -a ftp-live.app $i
or
open -a ftp-staging.app $i
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/379750
|
This comment has been minimized.
This comment has been minimized.
Nice one! Got the if statement working fine. However, it just seems to ignore the local file directory and puts them all to the root? echo "Transmitting..." |
This comment has been minimized.
This comment has been minimized.
Hmm…
I can't tell why it would put them at the root from the script you wrote.
Do those droplets work normally when you just drop files on them with the mouse?
— Thomas Aylott - SubtleGradient - MooTools - Facebook (from iPhone)
…On Mar 3, 2012, at 7:46 AM, ***@***.*** wrote:
Nice one!
Got the if statement working fine. However, it just seems to ignore the local file directory and puts them all to the root?
echo "Transmitting..."
for i in `git log -${2:-1} $3 --name-only|grep -E '^[^ ]+$'|sort|uniq`; do
if [[ -e $i ]]; then
echo " $i"
if [ $1 == 'live' ]
then
open -a ftp-live.app $i
fi
if [ $1 == 'staging' ]
then
open -a ftp-staging.app $i
fi
fi
done
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/379750
|
This comment has been minimized.
This comment has been minimized.
You're right, the droplet ignores any structure and just uploads it to the root with a mouse drag and drop.
That's a shame, I don't know if we'd be able to force it to respect the structure or tell it "where it has to go" with another argument.
|
This comment has been minimized.
This comment has been minimized.
@subtleGradient Thanks for this, it's great! |
This comment has been minimized.
This comment has been minimized.
@subtleGradient thanks for this, its great! I am also trying to configure this to deploy to specific ftp server/transmit favourites. It would be cool if I could get to check for a environment argument e.g $ git-transmit dev @dancourse did you manage to get this to work with specific Transmit favourite? At the moment the script will deploy to all favourites. |
This comment has been minimized.
This comment has been minimized.
Hey guys, checkout the fork I just uploaded. It's aims to be smart about only pushing files that have changed by using a local tag to track where the repo was at each time you do a push. https://gist.github.com/quickshiftin/8809435 |
This comment has been minimized.
it parses your
git log
for filesby default it looks at the most recent commit
but if you pass in a number it'll use that number of commits
and you can pass extra params after that too
e.g.
git-transmit 9999 --since=yesterday
to upload all files from the past 9999 commits since yesterday
it technically just tells Transmit to open each of those files
and then Transmit will do whatever it does
you could replace "Transmit" with the name of some other app if you prefer