This Question is Possibly Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
1 Replies Last post: Dec 22, 2011 2:32 PM by Pavel Sher  
Lau Kachun Newbie 1 posts since
Dec 19, 2011
Currently Being Moderated

Dec 19, 2011 10:54 AM

Can I change the working directory in code without input in web UI?

I have developed a custom build runner. It runs a batch file in the checkout directory in the agent.

 

In the source code, I use BuildServiceAdapter::makeProgramCommandLine() to return createProgramCommandLine( batchpath, arg ) to run the batch in agent.

 

Since the default build path is the checkout directory, while running the batch file, there is a warning saying that the batch file could not be run in UNC path. Although it changes the directory the C:/ automatically, the present of warning still makes someone feel not good.

 

So is there any function or interface that can change the working directory? As I don't want to input it in the UI for every project.

 

Thank you.

Pavel Sher JetBrains 2,148 posts since
Mar 6, 2008
Currently Being Moderated
Dec 22, 2011 2:32 PM in response to: Lau Kachun
Re: Can I change the working directory in code without input in web UI?

You can construct your own command line with help of jetbrains.buildServer.agent.runner.SimpleProgramCommandLine class. One of it constructos accepts custom working directory.

More Like This

  • Retrieving data ...