Skip to content

Commit

Permalink
Stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Albinlj committed Sep 23, 2019
1 parent e176707 commit 27fd381
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 17 deletions.
Binary file added StocksheetUpdater/Bok3_7_MSG019-L.xlsx
Binary file not shown.
Binary file added StocksheetUpdater/Bok3_7_MSG019-M.xlsx
Binary file not shown.
18 changes: 1 addition & 17 deletions StocksheetUpdater/Program.cs
Expand Up @@ -15,34 +15,18 @@ class Program
static async Task Main(string[] args)
{
var builder = new ConfigurationBuilder()
.SetBasePath(GetApplicationRoot())
.SetBasePath(Utils.GetApplicationRoot())
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);


IConfiguration configuration = builder.Build();


var serviceProvider = new ServiceCollection()
.AddOptions()
.Configure<MySettings>(configuration.GetSection("MySettings"))
.AddSingleton<IUpdater, Updater>()
.BuildServiceProvider();


var updater = serviceProvider.GetService<IUpdater>();


await updater.Run();

}

public static string GetApplicationRoot()
{
var exePath = Path.GetDirectoryName(System.Reflection
.Assembly.GetExecutingAssembly().CodeBase);
Regex appPathMatcher = new Regex(@"(?<!fil)[A-Za-z]:\\+[\S\s]*?(?=\\+bin)");
var appRoot = appPathMatcher.Match(exePath).Value;
return appRoot;
}
}
}
20 changes: 20 additions & 0 deletions StocksheetUpdater/Utils.cs
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;

namespace StocksheetUpdater
{
public static class Utils
{
public static string GetApplicationRoot()
{
var exePath = Path.GetDirectoryName(System.Reflection
.Assembly.GetExecutingAssembly().CodeBase);
Regex appPathMatcher = new Regex(@"(?<!fil)[A-Za-z]:\\+[\S\s]*?(?=\\+bin)");
var appRoot = appPathMatcher.Match(exePath).Value;
return appRoot;
}
}
}
Binary file added StocksheetUpdater/~$Bok3_7_MSG019-L.xlsx
Binary file not shown.
Binary file added StocksheetUpdater/~$Bok3_7_MSG019-M.xlsx
Binary file not shown.
Empty file added debrief.txt
Empty file.

0 comments on commit 27fd381

Please sign in to comment.