> Can't you write<br>> (build-path (getenv "WORKSPACE") ....)<div><br></div><div>The paths are command-line arguments and the tool is run in multiple places. When I run it locally I don't use environment variables, but it's also used as a script that's run on Jenkins after a project builds, and Jenkins defines the workspace variable.</div>
<div><br></div><div>I ended up just making a method that checks if the first path element starts with a $ and doing exactly what you said, but I was just hoping there was something already built in.</div><div><br></div><div>
> Could you push things through a call-out to 'system' with the 'echo' program?</div><div><br></div><div>I'm just copying a file, so I could use system to copy the file instead of Racket's copy-file, and that would take care of the environment stuff. That's probably better than my solution.</div>
<div><br></div><div>It would be nice to have a flag or something that tells a path function to resolve environment variables, but it's probably not a common enough case to merit an extra api function.</div><div><br></div>
<div>Thanks for the suggestions.<br><br><div class="gmail_quote">On Fri, Sep 28, 2012 at 4:32 PM, Jay McCarthy <span dir="ltr"><<a href="mailto:jay.mccarthy@gmail.com" target="_blank">jay.mccarthy@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Could you push things through a call-out to 'system' with the 'echo' program?<br>
<div class="HOEnZb"><div class="h5"><br>
On Fri, Sep 28, 2012 at 3:36 PM, Laurent <<a href="mailto:laurent.orseau@gmail.com">laurent.orseau@gmail.com</a>> wrote:<br>
> Can't you write<br>
> (build-path (getenv "WORKSPACE") ....)<br>
> ?<br>
><br>
> Laurent<br>
><br>
> On Fri, Sep 28, 2012 at 11:30 PM, Nick Shelley <<a href="mailto:nickmshelley@gmail.com">nickmshelley@gmail.com</a>><br>
> wrote:<br>
>><br>
>> I can't seem to find a path function that deals with environment<br>
>> variables. Is there some variant of cleanse-path that resolves environment<br>
>> variables first?<br>
>><br>
>> Concretely, I have an environment variable $WORKSPACE that tells where I'm<br>
>> operating from. The result of (getenv "WORKSPACE") is the correct absolute<br>
>> path, but (build-path "$WORKSPACE" ...) doesn't resolve the variable, so my<br>
>> filesystem commands are failing.<br>
>><br>
>> Thanks.<br>
>><br>
>> ____________________<br>
>> Racket Users list:<br>
>> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
>><br>
><br>
><br>
> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
><br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Jay McCarthy <<a href="mailto:jay@cs.byu.edu">jay@cs.byu.edu</a>><br>
Assistant Professor / Brigham Young University<br>
<a href="http://faculty.cs.byu.edu/~jay" target="_blank">http://faculty.cs.byu.edu/~jay</a><br>
<br>
"The glory of God is Intelligence" - D&C 93<br>
</font></span></blockquote></div><br></div>