Skip to content

Commit fb637bc

Browse files
committed
Actua fix for action build error :)
1 parent 8aadfda commit fb637bc

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

GithubWebpagesWebhook/PageViewer.cs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
#if !DEBUG
2-
using Azure.Storage.Blobs;
3-
#endif
1+
using Azure.Storage.Blobs;
42
using Microsoft.AspNetCore.Http;
53
using Microsoft.AspNetCore.Mvc;
64
using Microsoft.Azure.WebJobs;
75
using Microsoft.Azure.WebJobs.Extensions.Http;
86
using Microsoft.Extensions.Logging;
97
using System;
8+
using System.Diagnostics;
109
using System.IO;
1110
using System.Threading.Tasks;
1211

@@ -54,18 +53,21 @@ public static async Task<string> GenerateWebpageAsync()
5453

5554
public static async Task<string> GetTemplateFileAsync()
5655
{
57-
#if DEBUG
58-
return await File.ReadAllTextAsync("PageGenerator/index.html");
59-
#else
60-
var connectionString = Environment.GetEnvironmentVariable("AzureWebJobsStorage");
56+
if (Debugger.IsAttached)
57+
{
58+
return await File.ReadAllTextAsync("PageGenerator/index.html");
59+
}
60+
else
61+
{
62+
var connectionString = Environment.GetEnvironmentVariable("AzureWebJobsStorage");
6163

62-
// TODO read template location from env/dynamic way
63-
var blobClient = new BlobClient(connectionString, "html-templates", "index.html");
64+
// TODO read template location from env/dynamic way
65+
var blobClient = new BlobClient(connectionString, "html-templates", "index.html");
6466

65-
var content = await blobClient.DownloadContentAsync();
67+
var content = await blobClient.DownloadContentAsync();
6668

67-
return content.Value.Content.ToString();
68-
#endif
69+
return content.Value.Content.ToString();
70+
}
6971
}
7072
}
7173
}

0 commit comments

Comments
 (0)