microsoft / vso-agent

Visual Studio Team Services and TFS agent for Mac OSX and Linux
MIT License
131 stars 57 forks source link

tl.exec fails on linux and succeeds on windows when arguments are accessing another file in task folder #228

Closed mvvsubbu closed 8 years ago

mvvsubbu commented 8 years ago

Task folder has file1.js, sample.jar and run the following command using

tl.exec("java", " -classpath sample.jar:/usr/home/: Main"

The above command works on windows and fails on Linux saying Main class not found. This one is an issue because of the relative path of the sample.jar. In windows node handler is setting the current working directory to the task current version folder, where as on Linux it is not doing.

yacaovsnc commented 8 years ago

I am always using "path.join(__dirname, sample.jar');" in the typescript file whenever I needed to specify a jar packaged in the task.

Would that help?

mvvsubbu commented 8 years ago

Yes I am fixing that way. But given that it is general issue for any task, fixing it in agent makes more sense, similar to how windows agent is doing.

mvvsubbu commented 8 years ago

I got a confirmation from Bryan saying this designed to like this and hence closing the issue