Skip to content

Commit

Permalink
Fix for activescott#55
Browse files Browse the repository at this point in the history
An example workaround/fix for the \" issue.
I also changed it to only set the extract dir once to conform to the
documentation.
Oh, and it includes an error message, when the msi file doesn't exist,
because I was wondering about the exeption, while I just made a typo...
  • Loading branch information
Bioruebe committed Aug 6, 2016
1 parent 582cff9 commit ac63227
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/LessMsi.Cli/ExtractCommand.cs
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using NDesk.Options;

Expand All @@ -15,11 +16,13 @@ public override void Run(List<string> allArgs)

var i = 0;
var msiFile = args[i++];
if (!File.Exists(msiFile))
throw new OptionException("Invalid argument. Specified msi file does not exist.", "x");
var filesToExtract = new List<string>();
var extractDir = "";
if (i < args.Count)
{
if (args[i].EndsWith("\\"))
if (extractDir == "" && (args[i].EndsWith("\\") || args[i].EndsWith("\"")))
extractDir = args[i];
else
filesToExtract.Add(args[i]);
Expand Down

0 comments on commit ac63227

Please sign in to comment.