<commit_before>﻿using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Threading;

namespace FlubuCore.WebApi.Updater
{
    public class Program
    {
        public static void Main(string[] args)
        {
            Thread.Sleep(2000);
            
            string frameworkName = Assembly.GetEntryAssembly()?.GetCustomAttribute<TargetFrameworkAttribute>()
                ?.FrameworkName;
            var isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
            bool isNetCore = frameworkName.StartsWith(".NETCoreApp");
            string flubuPath, deployScript;
            if (isWindows)
            {
              
               flubuPath = Path.GetFullPath("Updates/WebApi/flubu.exe");
               if (isNetCore)
               {
                   deployScript = Path.GetFullPath("Updates/WebApi/DeployScript.cs");
               }
               else
               {
                   deployScript = Path.GetFullPath("Updates/WebApi/DeploymentScript.cs");
               }

             
            }
            else
            {
                flubuPath = Path.GetFullPath("Updates/WebApi/Deploy.bat");
                deployScript = Path.GetFullPath("Updates/WebApi/DeploymentScript.cs");
                var processRestore = Process.Start(new ProcessStartInfo
                {
                    WorkingDirectory = Path.GetDirectoryName(flubuPath),
                    FileName = "dotnet restore",
                    Arguments = "Deploy.csproj",
                });

                processRestore.WaitForExit();
            }

            Console.WriteLine($"path: {deployScript}");
            var process = Process.Start(new ProcessStartInfo
            {
                WorkingDirectory = Path.GetDirectoryName(flubuPath),
                FileName = "dotnet flubu",
                Arguments = $"-s={deployScript}"
            });
         
            process.WaitForExit();
            int code = process.ExitCode;
            Console.WriteLine($"flubu exit code: {code}");
        }
    }
}
<commit_msg>fixes update for win.<commit_after>﻿using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Threading;

namespace FlubuCore.WebApi.Updater
{
    public class Program
    {
        public static void Main(string[] args)
        {
            Thread.Sleep(2000);
            
            string frameworkName = Assembly.GetEntryAssembly()?.GetCustomAttribute<TargetFrameworkAttribute>()
                ?.FrameworkName;
            var isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
            bool isNetCore = frameworkName.StartsWith(".NETCoreApp");
            string flubuPath, deployScript;
            if (isWindows)
            {
              
               flubuPath = Path.GetFullPath("Updates/WebApi/flubu.exe");
               if (isNetCore)
               {
                   deployScript = Path.GetFullPath("Updates/WebApi/DeployScript.cs");
               }
               else
               {
                   deployScript = Path.GetFullPath("Updates/WebApi/DeploymentScript.cs");
               }

             
            }
            else
            {
                flubuPath = Path.GetFullPath("Updates/WebApi/Deploy.bat");
                deployScript = Path.GetFullPath("Updates/WebApi/DeploymentScript.cs");
                var processRestore = Process.Start(new ProcessStartInfo
                {
                    WorkingDirectory = Path.GetDirectoryName(flubuPath),
                    FileName = "dotnet restore",
                    Arguments = "Deploy.csproj",
                });

                processRestore.WaitForExit();
            }

            Console.WriteLine($"path: {deployScript}");
            var process = Process.Start(new ProcessStartInfo
            {
                WorkingDirectory = Path.GetDirectoryName(flubuPath),
                FileName = isWindows ? flubuPath : "dotnet flubu",
                Arguments = $"-s={deployScript}"
            });
         
            process.WaitForExit();
            int code = process.ExitCode;
            Console.WriteLine($"flubu exit code: {code}");
        }
    }
}

{'fraction_non_alphanumeric': 0.09292237442922374, 'fraction_numerical': 0.0018264840182648401, 'mean_word_length': 1.587714116952156, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6796471', 'n_tokens_mistral': 1129, 'n_tokens_neox': 1072, 'n_words': 179}