Skip to content

Commit

Permalink
Fixing path issues
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiocav committed Oct 12, 2017
1 parent d13ad18 commit 27fd5db
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/WebJobs.Script.WebHost/WebHostResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,19 +187,19 @@ private static void InitializeFileSystem()
if (!string.IsNullOrEmpty(home))
{
// Delete hostingstart.html if any. Azure creates that in all sites by default
string siteRootPath = Path.Combine(home, @"site\wwwroot");
string siteRootPath = Path.Combine(home, "site", "wwwroot");
string hostingStart = Path.Combine(siteRootPath, "hostingstart.html");
if (File.Exists(hostingStart))
{
File.Delete(hostingStart);
}

// Create the tools folder if it doesn't exist
string toolsPath = Path.Combine(home, @"site\tools");
string toolsPath = Path.Combine(home, "site", "tools");
Directory.CreateDirectory(toolsPath);

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

string path = Environment.GetEnvironmentVariable("PATH");
string additionalPaths = string.Join(";", folders);
Expand Down
6 changes: 3 additions & 3 deletions src/WebJobs.Script.WebHost/WebHostSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ internal static WebHostSettings CreateDefault(ScriptSettingsManager settingsMana
if (settingsManager.IsAzureEnvironment)
{
string home = settingsManager.GetSetting(EnvironmentSettingNames.AzureWebsiteHomePath);
settings.ScriptPath = Path.Combine(home, @"site\wwwroot");
settings.LogPath = Path.Combine(home, @"LogFiles\Application\Functions");
settings.SecretsPath = Path.Combine(home, @"data\Functions\secrets");
settings.ScriptPath = Path.Combine(home, "site", "wwwroot");
settings.LogPath = Path.Combine(home, "LogFiles", "Application", "Functions");
settings.SecretsPath = Path.Combine(home, @"data", "Functions", "secrets");
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public Uri FunctionBaseUri
{
if (_functionBaseUri == null)
{
_functionBaseUri = new Uri(Path.GetDirectoryName(Metadata.ScriptFile) + "\\", UriKind.RelativeOrAbsolute);
_functionBaseUri = new Uri(Path.GetDirectoryName(Metadata.ScriptFile) + Path.DirectorySeparatorChar, UriKind.RelativeOrAbsolute);
}

return _functionBaseUri;
Expand Down
6 changes: 3 additions & 3 deletions src/WebJobs.Script/Description/DotNet/PackageManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public static string ResolveNuGetPath()
//// If we don't have the path, get the runtime's copy of NuGet
if (string.IsNullOrEmpty(path))
{
string runtimeNugetPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "bin\\tools", NuGetFileName);
string runtimeNugetPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "bin", "tools", NuGetFileName);

if (File.Exists(runtimeNugetPath))
{
Expand Down Expand Up @@ -305,12 +305,12 @@ internal static string GetNugetPackagesPath()
// We're hosted in Azure
// Set the NuGet path to %home%\data\Functions\packages\nuget
// (i.e. d:\home\data\Functions\packages\nuget)
nugetHome = Path.Combine(home, "data\\Functions\\packages\\nuget");
nugetHome = Path.Combine(home, "data", "Functions", "packages", "nuget");
}
else
{
string userProfile = Environment.ExpandEnvironmentVariables("%userprofile%");
nugetHome = Path.Combine(userProfile, ".nuget\\packages");
nugetHome = Path.Combine(userProfile, ".nuget", "packages");
}

return nugetHome;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private string GetSentinelFilePath(string functionName)
home = Path.Combine(Path.GetTempPath(), "AzureFunctions");
}

return Path.Combine(home, $@"data\Functions\CompilationOutput\{Language}\{functionName}\.output");
return Path.Combine(home, "data", "Functions", "CompilationOutput", Language, functionName, ".output");
}

private class JavaScriptCompilation : IJavaScriptCompilation
Expand Down

0 comments on commit 27fd5db

Please sign in to comment.