fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] OS X and fabric.contrib.files.exists


From: Niklas Lindström
Subject: Re: [Fab-user] OS X and fabric.contrib.files.exists
Date: Tue, 2 Jun 2009 01:54:54 +0200

Hi,

I see (I figured there was good reason for it). It's nothing really
crucial for me either (in this case I just tested against my own
machine; so far I'm deploying soley to linux boxes).

OTOH, it might be beneficial to use the `test` command for utils like
`exists`, `isdir` instead. E.g.:

    cmd = 'test -e %s' % path
    ...
    with settings(hide('everything'), warn_only=True):
        return run(cmd).return_code == 0

(I could do a patch with this tomorrow; way out of sync with time tonight.)

Best regards,
Niklas


2009/6/2 Jeff Forcier <address@hidden>:
> 2009/6/1 Niklas Lindström <address@hidden>:
>> Hi again,
>>
>> I just noticed that `fabric.contrib.files.exists` doesn't work on OS
>> X, due to the "--color" flag. Is that a necessary precaution for some
>> systems, or could it be removed altogether?
>
> A number of things in the contrib.* files are unlikely to be fully
> portable right now, unfortunately, since they're still largely based
> on stuff I wrote for my own environment.
>
> I'd like to make them moreso (I'd also like to put in ANSI color
> stripping so passing --color=never isn't necessary) but for now, if I
> take that flag out it won't work for me or anyone else with color 'ls'
> enabled on the remote end, so it becomes a "who to inconvenience" game
> with color 'ls' folks vs non-GNU-ls ones :)
>
> We could put in a stopgap solution which checks system type and omits
> the --color if it doesn't appear to be Linux, e.g. "if run('uname -s')
> != 'Linux'". I've done this in my dotfiles for similar reasons, with
> some success.
>
> -Jeff
>




reply via email to

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