Skip to content

Commit 4f5c046

Browse files
committed
I am an idiot
1 parent fb637bc commit 4f5c046

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

GithubWebpagesWebhook/PageViewer.cs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
using Azure.Storage.Blobs;
1+
#if !DEBUG
2+
using Azure.Storage.Blobs;
3+
#endif
24
using Microsoft.AspNetCore.Http;
35
using Microsoft.AspNetCore.Mvc;
46
using Microsoft.Azure.WebJobs;
57
using Microsoft.Azure.WebJobs.Extensions.Http;
68
using Microsoft.Extensions.Logging;
79
using System;
8-
using System.Diagnostics;
910
using System.IO;
1011
using System.Threading.Tasks;
1112

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

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

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

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

69-
return content.Value.Content.ToString();
70-
}
67+
return content.Value.Content.ToString();
68+
#endif
7169
}
7270
}
7371
}

GithubWebpagesWebhook/WebHook.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#if !DEBUG
2+
using Azure.Storage.Blobs;
3+
#endif
14
using System.Threading.Tasks;
25
using Microsoft.AspNetCore.Mvc;
36
using Microsoft.Azure.WebJobs;

0 commit comments

Comments
 (0)