Skip to content

Commit d4e7188

Browse files
committed
v1.1.1
- Fix for file/path parameter during CLAR_UPLOAD
1 parent 55cdd43 commit d4e7188

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

CLARiNET.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<PackageIcon>CLARiNET.ico</PackageIcon>
88
<PackageIconUrl />
99
<ApplicationIcon>CLARiNET.ico</ApplicationIcon>
10-
<Version>1.1.0</Version>
10+
<Version>1.1.1</Version>
1111
</PropertyGroup>
1212

1313
<ItemGroup>

Program.cs

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -265,23 +265,31 @@ static bool InitOptions(string[] args)
265265
options.Command = options.Command.Trim().ToUpper();
266266
}
267267

268+
// Path parameter is a file
269+
if (options != null && options.Path != null && options.Command == Command.CLAR_UPLOAD)
270+
{
271+
if (File.Exists(options.Path))
272+
{
273+
searchPattern = Path.GetFileName(options.Path);
274+
options.Path = options.Path.Substring(0, options.Path.Length - searchPattern.Length);
275+
}
276+
}
277+
268278
// Set search pattern and cloud collection if parameters are included.
269279
if (options != null && options.Parameters != null)
270280
{
271281
switch (options.Command)
272282
{
273-
case Command.CLAR_UPLOAD:
283+
case Command.CLAR_UPLOAD:
284+
cloudCollection = options.Parameters;
285+
break;
274286
case Command.CLAR_DOWNLOAD:
275-
if (options.Command == Command.CLAR_DOWNLOAD)
276-
{
277-
searchPattern = "";
278-
options.Parameters = Path.GetFileName(Path.TrimEndingDirectorySeparator(options.Parameters));
279-
}
287+
searchPattern = "";
288+
options.Parameters = Path.GetFileName(Path.TrimEndingDirectorySeparator(options.Parameters));
280289
cloudCollection = options.Parameters;
281290
break;
282291
case Command.DRIVE_UPLOAD:
283-
case Command.DRIVE_TRASH:
284-
292+
case Command.DRIVE_TRASH:
285293
searchPattern = options.Parameters;
286294
break;
287295
case Command.PHOTO_DOWNLOAD:
@@ -402,7 +410,10 @@ static void ParameterOption()
402410
cloudCollection = Console.ReadLine().Trim();
403411
Console.WriteLine("");
404412
options.Parameters = cloudCollection;
405-
searchPattern = "*.clar";
413+
if (searchPattern.ToLower().IndexOf(".clar") < 0)
414+
{
415+
searchPattern = "*.clar";
416+
}
406417
if (options.Command == Command.CLAR_DOWNLOAD)
407418
{
408419
searchPattern = "";

0 commit comments

Comments
 (0)