fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] RFC: Implementing a current working directory / path refa


From: Christian Vest Hansen
Subject: Re: [Fab-user] RFC: Implementing a current working directory / path refactoring feature
Date: Mon, 24 Nov 2008 09:36:48 +0100

On Sun, Nov 23, 2008 at 6:38 PM, Nicolas Steinmetz <address@hidden> wrote:
> if it means somehting like :
> co workdir
> scp build/package.tar.gz server:/workdir/build/package.tar.gz,
> Then, I'm not fan of it as it assumes you have the same directory structure
> on your deployment server and one the target server(s).

More like this:

scp build/package.tar.gz server:workdir/package.tar.gz

The 'cd'ing only affects remote paths, and I think the mental model is
simpler when it also affect _all_ remote paths.

> In my case, it's not
> the case and I put my archive in /tmp/ and then use them as I want.

Then change this:

put('build/package.tar.gz', 'package.tar.gz')

Into this:

put('build/package.tar.gz', '/tmp/package.tar.gz')

As I understood Jeff and his `os.path` trickery, it should be possible
to replicate the behaviour normal shells and `cd`, which means that
absolute paths still work regardless of where you are on the file
system.

> Making the workdir implicit seems for me too magical and source of
> confusion. If the workdir is to be used, it has to be mentioned explicitely.
> It would also help user to appropriate fabfile content if they are not the
> creator/maitenor of the file.

I disagree.

Calling a `cd()` operaion seem pretty explicit to me, likewise do
absolute paths when you need to make exceptions in a group of calls.

However, if we make exceptions to which remote paths a `cd()` will
affect, then that is the kind of knowledge that is hard to read from
the code - you'll have to consult the documentation.

And if we have one exception to a rule, then we might have more (like
the `download()` operation), and then you have to keep those in mind
when you read/write a `cd()`.

I think we'll have less confusion if `cd()` is defined with a simple
rule with no exceptions: It changes the remote working directory.

> My 2 cents,
> Nicolas
> --
> Nicolas Steinmetz
> http://www.steinmetz.fr - http://www.unelectronlibre.info/
>
> _______________________________________________
> Fab-user mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/fab-user
>
>



-- 
Venlig hilsen / Kind regards,
Christian Vest Hansen.




reply via email to

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