From ddb74a7beea4b94262919235793ad3a6654ca0d8 Mon Sep 17 00:00:00 2001 From: Adam R Grey Date: Wed, 14 Dec 2022 18:02:14 -0500 Subject: [PATCH] fix bugs, fix jenkinsfile, nuget mysteriously now cooperating --- Jenkinsfile | 19 ++++++++++++++----- Program.cs | 6 +++--- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 007e6ba..bfc71e8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,12 +4,21 @@ pipeline { dotnetsdk 'dotnet6' } stages { - stage('Build') { + stage('clean old'){ + steps{ + sh 'rm -rf bin obj' + } + } + stage('linux') { steps { - dotnetClean - echo 'Building..' - sh 'dotnet publish --configuration Release --output PUBLISH-linux --os linux' - sh 'dotnet publish --configuration Release --output PUBLISH-windows --os windows' + sh 'dotnet publish --configuration Release --os linux' + archiveArtifacts artifacts: 'bin/Release/net/net6.0/linux-x64/publish/*' + } + } + stage('windows') { + steps { + sh 'dotnet publish --configuration Release --os windows' + archiveArtifacts artifacts: 'bin/Release/net/net6.0/windows-x64/publish/*' } } } diff --git a/Program.cs b/Program.cs index 85d9fa9..cebab37 100644 --- a/Program.cs +++ b/Program.cs @@ -34,10 +34,10 @@ namespace directors_assistant Console.WriteLine($"executing {cmd.name}{(ec.args != null ? ", given args " + string.Join(' ', ec.args) : "")} with timeout {ec.timeout}"); var cmdAndArgs = cmd.shell.Split(' '); - var justArgs = cmdAndArgs.Skip(1).ToList(); - if(ec.args?.Count > 0) + var justArgs = string.Join(' ', cmdAndArgs.Skip(1).ToList()); + if(!string.IsNullOrWhiteSpace(ec.args)) { - justArgs.AddRange(ec.args); + justArgs += ec.args; } var commandPath = cmdAndArgs[0]; var commandArguments = String.Join(' ', justArgs);