fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] how to change present working directory?


From: Bryan Berry
Subject: Re: [Fab-user] how to change present working directory?
Date: Tue, 14 Oct 2008 14:18:14 +0545

On Tue, 2008-10-14 at 10:08 +0200, Christian Vest Hansen wrote:
> On Tue, Oct 14, 2008 at 9:58 AM, Bryan Berry <address@hidden> wrote:
> > thanks Jeff!
> >
> > this does the trick w/ git
> >
> > git-dir="--git-dir=/home/hitman/Prog/test1/.git"
> > fabric.run("git $(git-dir) fetch $(my_remote_repo)")
> >
> > another quick question, how can I specify args for operations like
> > deploy? do operations not take args?
> >
> > I want to pass the application my version tag # as an argument
> >
> > right now I am using prompt('version', "Input the version you want to
> > deploy")
> > version = ENV['version']
> 
> Given a fabfile like this:
> 
> def hello(**args):
>   print "Got args:", args
> 
> Then:
> 
> [cvh: ~]$ fab hello:a=b
>    Fabric v. 0.0.9, Copyright (C) 2008 Christian Vest Hansen.
>    Fabric comes with ABSOLUTELY NO WARRANTY; for details type `fab warranty'.
>    This is free software, and you are welcome to redistribute it
>    under certain conditions; type `fab license' for details.
> 
> Running hello...
> Got args: {'a': 'b'}
> Done.

Mostly, I figured out how to use **myarg yesterday but I was trying to
just pass a simple parameter rather than a keyword=arg object (a
dictionary?)

def hello(arg):
        print "Got an arg", arg

But when I was playing w/ this I didn't use a comma after the string,
perhaps this was my error

thanks for being so responsive ;)

-- 
Bryan W. Berry
Technology Director
OLE Nepal, http://www.olenepal.org





reply via email to

[Prev in Thread] Current Thread [Next in Thread]