cabal-dev icon indicating copy to clipboard operation
cabal-dev copied to clipboard

Allow to specify sandbox location via environment variable

Open hvr opened this issue 14 years ago • 3 comments

It would be convenient to be able to specify the default sandbox location (which currently seems hard-coded to ./cabal-dev) via an environment variable. The -s/--sandbox=DIR option should have always precedence over the location set via an environment variable.

hvr avatar Sep 24 '11 20:09 hvr

This seems reasonable to me - does anyone have suggestions for a name? I'm a /little/ concerned about name clashes, but that's probably just me being paranoid.

@hvr: in the short term, it should be easy to work around this with a shell script that inserts a variable of your choice and passes the remaining arguments on to cabal-dev.

This should work:

#!/bin/bash

CABAL_DEV=/path/to/cabal-dev
$CABAL_DEV --sandbox=$(eval 'echo '"$SANDBOX_VAR") "$@"

creswick avatar Sep 24 '11 22:09 creswick

...what about a more or less verbose variable called CABAL_SANDBOX?

hvr avatar Sep 25 '11 06:09 hvr

Just wanted to say that I wrote a script called sandboxer that takes care of this by wrapping cabal-dev using a script similar to creswick's.

If you wanted to be super fancy about it you could do something like the virtualenv-burrito approach and make all the sandboxes in ~/.cabal-dev/sandboxes/sandbox_name or something.

lightquake avatar Jul 08 '12 00:07 lightquake