Skip to content

Commit

Permalink
Update to .NET 6, handle ` in remote path
Browse files Browse the repository at this point in the history
lftp arguments needed to have apostrophes in remote file names escaped
  • Loading branch information
ScottRFrost committed Nov 15, 2021
1 parent e3ebc11 commit a938cec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/SimpleSFTPSyncCore/SimpleSFTPSync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void StartRun()
else
{
// You may need to ssh manually once to save the host key
var args = string.Concat("-u ", config.username, ",", config.password, " -e \"pget -c -n ", config.lftp, " '", syncFile.RemotePath, "' -o '", localPath, "'; exit\" sftp://", config.hostname, ":", config.port);
var args = string.Concat("-u ", config.username, ",", config.password, " -e \"pget -c -n ", config.lftp, " '", syncFile.RemotePath.Replace("'","\\'"), "' -o '", localPath.Replace("'","\\'"), "'; exit\" sftp://", config.hostname, ":", config.port);
//// Log(" lftp args: " + args.Replace(config.password, "***")); // Debug
var processStartInfo = new ProcessStartInfo
{
Expand Down
16 changes: 8 additions & 8 deletions src/SimpleSFTPSyncCore/SimpleSFTPSyncCore.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<VersionPrefix>5.0.0</VersionPrefix>
<TargetFramework>net5.0</TargetFramework>
<VersionPrefix>6.0.0</VersionPrefix>
<TargetFramework>net6.0</TargetFramework>
<AssemblyName>SimpleSFTPSyncCore</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>SimpleSFTPSyncCore</PackageId>
<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
<PublishTrimmed>false</PublishTrimmed>
<RuntimeFrameworkVersion>5.0.0</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>6.0.0</RuntimeFrameworkVersion>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Version>5.0.0</Version>
<Version>6.0.0</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>bin\Debug\</OutputPath>
Expand All @@ -25,10 +25,10 @@
</ItemGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Design" Version="1.1.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.9">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down

0 comments on commit a938cec

Please sign in to comment.