Skip to content
This repository was archived by the owner on May 13, 2022. It is now read-only.

Commit 4579eab

Browse files
authored
Merge pull request #13 from unosquare/Issue12-DirectoryNotFoundException
Closes #12 path fixed when AppendTargetFrameworkToOutputPath set to false in csproj
2 parents 575b2b1 + 2d58d03 commit 4579eab

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

Unosquare.Labs.SshDeploy/Options/PushVerbOptions.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@ public class PushVerbOptions : CliExecuteOptionsBase
88
private const string BinFolder = "bin";
99
private const string PublishFolder = "publish";
1010

11-
[ArgumentOption('c', "configuration", DefaultValue = "Debug",
12-
HelpText = "Target configuration. The default for most projects is 'Debug'.", Required = false)]
11+
public static bool IgnoreTargetFrameworkToOutputPath { get; set; }
12+
13+
[ArgumentOption('c', "configuration", DefaultValue = "Debug", HelpText = "Target configuration. The default for most projects is 'Debug'.", Required = false)]
1314
public string Configuration { get; set; }
1415

15-
[ArgumentOption('f', "framework", HelpText = "The target framework has to be specified in the project file.",
16-
Required = true)]
16+
[ArgumentOption('f', "framework", HelpText = "The target framework has to be specified in the project file.", Required = true)]
1717
public string Framework { get; set; }
1818

19-
[ArgumentOption('r', "runtime", HelpText = "The given runtime used for creating a self-contained deployment",
20-
DefaultValue = "",Required = false)]
19+
[ArgumentOption('r', "runtime", HelpText = "The given runtime used for creating a self-contained deployment", DefaultValue = "",Required = false)]
2120
public string Runtime { get; set; }
2221

23-
public string SourcePath => Path.Combine(Program.CurrentDirectory, BinFolder, Configuration, Framework, Runtime, PublishFolder);
22+
public string SourcePath => IgnoreTargetFrameworkToOutputPath ?
23+
Path.Combine(Program.CurrentDirectory, BinFolder, Configuration, Runtime, PublishFolder) :
24+
Path.Combine(Program.CurrentDirectory, BinFolder, Configuration, Framework, Runtime, PublishFolder);
2425
}
2526
}

Unosquare.Labs.SshDeploy/Unosquare.Labs.SshDeploy.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<PackAsTool>true</PackAsTool>
88
<AssemblyName>dotnet-sshdeploy</AssemblyName>
99
<PackageId>dotnet-sshdeploy</PackageId>
10-
<Version>0.3.0</Version>
11-
<PackageVersion>0.3.0</PackageVersion>
10+
<Version>0.3.1</Version>
11+
<PackageVersion>0.3.1</PackageVersion>
1212
<Authors>Unosquare</Authors>
1313
<Description>A command-line tool that enables quick deployments over SSH. This is program was specifically designed to streamline .NET application development for the Raspberry Pi running Raspbian.</Description>
1414

Unosquare.Labs.SshDeploy/Utils/CsProjNuGetMetadata.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System;
66
using System.Linq;
77
using System.Reflection;
8+
using Unosquare.Labs.SshDeploy.Options;
89

910
public class CsProjNuGetMetadata : CsProjMetadataBase
1011
{
@@ -100,6 +101,7 @@ public override void ParseCsProjTags(ref string[] args)
100101
}
101102

102103
args = argsList.ToArray();
104+
PushVerbOptions.IgnoreTargetFrameworkToOutputPath = FindElement("AppendTargetFrameworkToOutputPath")?.Value?.ToLowerInvariant() == "false";
103105
}
104106

105107
private static Type GetAttributeType(string[] args)

0 commit comments

Comments
 (0)