-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
205 additions
and
69 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
starsky/starsky.feature.dependenciescli/DependenciesCliService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Runtime.InteropServices; | ||
using starsky.foundation.database.Data; | ||
using starsky.foundation.database.Helpers; | ||
using starsky.foundation.platform.Helpers; | ||
using starsky.foundation.platform.Interfaces; | ||
using starsky.foundation.platform.Models; | ||
using starsky.foundation.writemeta.Interfaces; | ||
|
||
namespace starsky.feature.dependenciescli; | ||
|
||
public class DependenciesCliService | ||
{ | ||
private IExifToolDownload _exifToolDownload; | ||
private readonly ApplicationDbContext _dbContext; | ||
private IWebLogger _logger; | ||
private AppSettings _appSettings; | ||
|
||
public DependenciesCliService(IExifToolDownload exifToolDownload, | ||
ApplicationDbContext dbContext, IWebLogger logger, AppSettings appSettings) | ||
{ | ||
_exifToolDownload = exifToolDownload; | ||
_dbContext = dbContext; | ||
_logger = logger; | ||
_appSettings = appSettings; | ||
} | ||
|
||
public async Task Run(OSPlatform? currentPlatform = null, Architecture? architecture = null) | ||
{ | ||
currentPlatform ??= PlatformParser.GetCurrentOsPlatform(); | ||
await RunMigrations.Run(_dbContext, _logger, _appSettings); | ||
await _exifToolDownload.DownloadExifTool(currentPlatform == OSPlatform.Windows); | ||
|
||
} | ||
|
||
|
||
} |
5 changes: 5 additions & 0 deletions
5
starsky/starsky.feature.dependenciescli/Interfaces/IDependenciesCliService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
namespace starsky.feature.dependenciescli.Interfaces; | ||
|
||
public interface IDependenciesCliService | ||
{ | ||
} |
13 changes: 13 additions & 0 deletions
13
starsky/starsky.feature.dependenciescli/starsky.feature.dependenciescli.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\starsky.foundation.writemeta\starsky.foundation.writemeta.csproj"/> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
starsky/starsky.foundation.platform/Helpers/PlatformParser.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace starsky.foundation.platform.Helpers; | ||
|
||
public static class PlatformParser | ||
{ | ||
public static OSPlatform? GetCurrentOsPlatform() | ||
{ | ||
OSPlatform? currentPlatform = null; | ||
foreach ( var platform in new List<OSPlatform> | ||
{ | ||
OSPlatform.Linux, | ||
OSPlatform.Windows, | ||
OSPlatform.OSX, | ||
OSPlatform.FreeBSD | ||
}.Where(RuntimeInformation.IsOSPlatform) ) | ||
{ | ||
currentPlatform = platform; | ||
} | ||
|
||
return currentPlatform; | ||
} | ||
|
||
public static string GetCurrentArchitecture() | ||
{ | ||
return RuntimeInformation.RuntimeIdentifier; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
starsky/starskydependenciescli/default-init-launchSettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/launchsettings.json", | ||
"profiles": { | ||
"starskydependenciescli": { | ||
"commandName": "Project", | ||
"commandLineArgs": "-h", | ||
"environmentVariables": { | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.