[TxMt] Remote projects
Kumar McMillan
kumar.mcmillan at gmail.com
Fri Sep 23 02:47:39 UTC 2005
On 9/21/05, Steve Lianoglou <lists at arachnedesign.net> wrote:
>
> > or the file (if no project). The script also adds some sugar, like
> > --exclude ".svn" --exclude ".DS_Store" and guesses some paths, can
> > handle multiple servers/users, etc. If anyone would be interested in
> > the script let me know.
> >
> > In response to Sean's request, "build rsync into TextMate" : *ahem* it
> > is built in :)
>
> It doesn't seem like anyone has said it yet, but I'd be interested ;-)
Sure. It's attached as psync.py, knock yourself out. It's also
useful from the command line, and you can run psync.py -h to see all
the options.
I would add it to the TextMate repository but it is sort of a hack in
that it assumes you put all your project files in *one* directory
named the same as the project filename (without the extension). There
are more details about this in code comments. It's convenient for me
to make all my projects like this anyway ... maybe you can live with
it too.
Put the script somewhere in your search path (i.e. /usr/local/bin) and
add this command to your Custom bundle:
# needs trailing slash on your sandbox :
SBOX=~/Sites/
SERV=wherever.net
if [ ${#TM_PROJECT_FILEPATH} -ne 0 ]; then
psync.py -l $SBOX -p "$TM_PROJECT_FILEPATH" -H $SERV
else
file="${TM_FILEPATH:${#SBOX}}"
if [ ! -f "$file" ]; then
echo "file sync would only work if ${TM_FILEPATH} was relative to ${SBOX}"
exit 1
fi
psync.py -l $SBOX -f "$file" -H $SERV
fi
_
.. you will need to swap ssh keys with the remote host otherwise it
won't work from TM (will try to ask for your password).
Anyway, this started out as a simple rsync command then grew and grew
as I started using it for different purposes. I'm sure most people
will still be fine just constructing an rsync command with variables
inside a project or as separate TM commands.
K
-------------- next part --------------
A non-text attachment was scrubbed...
Name: psync.py
Type: application/octet-stream
Size: 7557 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20050922/ba63d4ec/attachment.py>
More information about the textmate
mailing list