From 5d7a74eece5e0a652d4f4ed2a9250efb1eab8255 Mon Sep 17 00:00:00 2001 From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Date: Tue, 14 Nov 2023 20:05:15 +0200 Subject: [PATCH] Switch to .NET 8 --- .github/workflows/main.yml | 4 ++-- Directory.Build.props | 2 +- DiscordChatExporter.Cli.dockerfile | 4 ++-- DiscordChatExporter.Cli/Commands/Base/ExportCommandBase.cs | 3 +-- DiscordChatExporter.Core/Utils/PathEx.cs | 3 --- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6d0ff680..d4cf13ac 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,7 +22,7 @@ jobs: - name: Install .NET uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # 3.2.0 with: - dotnet-version: 7.0.x + dotnet-version: 8.0.x - name: Run tests # Tests need access to secrets, so we can't run them against PRs because of limited trust @@ -62,7 +62,7 @@ jobs: - name: Install .NET uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # 3.2.0 with: - dotnet-version: 7.0.x + dotnet-version: 8.0.x - name: Publish app run: > diff --git a/Directory.Build.props b/Directory.Build.props index fac9289a..b047747b 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - net7.0 + net8.0 2.42.3 Tyrrrz Copyright (c) Oleksii Holub diff --git a/DiscordChatExporter.Cli.dockerfile b/DiscordChatExporter.Cli.dockerfile index 350cebcc..595e1ab7 100644 --- a/DiscordChatExporter.Cli.dockerfile +++ b/DiscordChatExporter.Cli.dockerfile @@ -1,7 +1,7 @@ # -- Build # Specify the platform here so that we pull the SDK image matching the host platform, # instead of the target platform specified during build by the `--platform` option. -FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:7.0-alpine AS build +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build # Expose the target architecture set by the `docker build --platform` option, so that # we can build the assembly for the correct platform. @@ -26,7 +26,7 @@ RUN dotnet publish DiscordChatExporter.Cli \ # -- Run # Use `runtime-deps` instead of `runtime` because we have a self-contained assembly -FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/runtime-deps:7.0-alpine AS run +FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/runtime-deps:8.0-alpine AS run LABEL org.opencontainers.image.title="DiscordChatExporter.Cli" LABEL org.opencontainers.image.description="DiscordChatExporter is an application that can be used to export message history from any Discord channel to a file." diff --git a/DiscordChatExporter.Cli/Commands/Base/ExportCommandBase.cs b/DiscordChatExporter.Cli/Commands/Base/ExportCommandBase.cs index 711fa1f1..f740e267 100644 --- a/DiscordChatExporter.Cli/Commands/Base/ExportCommandBase.cs +++ b/DiscordChatExporter.Cli/Commands/Base/ExportCommandBase.cs @@ -16,7 +16,6 @@ using DiscordChatExporter.Core.Exceptions; using DiscordChatExporter.Core.Exporting; using DiscordChatExporter.Core.Exporting.Filtering; using DiscordChatExporter.Core.Exporting.Partitioning; -using DiscordChatExporter.Core.Utils; using DiscordChatExporter.Core.Utils.Extensions; using Gress; using Spectre.Console; @@ -163,7 +162,7 @@ public abstract class ExportCommandBase : DiscordCommandBase || OutputPath.Contains('%') // Otherwise, require an existing directory or an unambiguous directory path || Directory.Exists(OutputPath) - || PathEx.IsDirectoryPath(OutputPath); + || Path.EndsInDirectorySeparator(OutputPath); if (!isValidOutputPath) { diff --git a/DiscordChatExporter.Core/Utils/PathEx.cs b/DiscordChatExporter.Core/Utils/PathEx.cs index 598d72c9..c85b54aa 100644 --- a/DiscordChatExporter.Core/Utils/PathEx.cs +++ b/DiscordChatExporter.Core/Utils/PathEx.cs @@ -27,7 +27,4 @@ public static class PathEx return buffer.ToString(); } - - public static bool IsDirectoryPath(string path) => - path.EndsWith(Path.DirectorySeparatorChar) || path.EndsWith(Path.AltDirectorySeparatorChar); }