Skip to content

Commit d717baf

Browse files
committed
Fix updating PATH for non-Windows platforms. Fixes #2916
1 parent 9ed6005 commit d717baf

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/WebJobs.Script.WebHost/WebHostResolver.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ private static void InitializeFileSystem(WebHostSettings settings, bool readOnly
261261
if (!readOnlyFileSystem)
262262
{
263263
// Delete hostingstart.html if any. Azure creates that in all sites by default
264-
string siteRootPath = Path.Combine(home, @"site\wwwroot");
264+
string siteRootPath = Path.Combine(home, "site", "wwwroot");
265265
string hostingStart = Path.Combine(siteRootPath, "hostingstart.html");
266266
if (File.Exists(hostingStart))
267267
{
@@ -272,7 +272,7 @@ private static void InitializeFileSystem(WebHostSettings settings, bool readOnly
272272
if (!readOnlyFileSystem)
273273
{
274274
// Create the tools folder if it doesn't exist
275-
string toolsPath = Path.Combine(home, @"site\tools");
275+
string toolsPath = Path.Combine(home, "site", "tools");
276276
Directory.CreateDirectory(toolsPath);
277277

278278
// Create the test data folder
@@ -283,15 +283,16 @@ private static void InitializeFileSystem(WebHostSettings settings, bool readOnly
283283
}
284284

285285
var folders = new List<string>();
286-
folders.Add(Path.Combine(home, @"site\tools"));
286+
folders.Add(Path.Combine(home, @"site", "tools"));
287287

288288
string path = Environment.GetEnvironmentVariable("PATH");
289-
string additionalPaths = string.Join(";", folders);
289+
// PathSeperator is ; on Windows and : on Unix
290+
string additionalPaths = string.Join(Path.PathSeparator, folders);
290291

291292
// Make sure we haven't already added them. This can happen if the appdomain restart (since it's still same process)
292293
if (!path.Contains(additionalPaths))
293294
{
294-
path = additionalPaths + ";" + path;
295+
path = additionalPaths + Path.PathSeparator + path;
295296

296297
Environment.SetEnvironmentVariable("PATH", path);
297298
}

0 commit comments

Comments
 (0)