private int RunCommand() { var targetPath = _target.Value(); if (string.IsNullOrWhiteSpace(targetPath)) { WriteLine("A target .cab file was not specified"); return(1); } var presetPath = _preFile.Value(); if (string.IsNullOrWhiteSpace(presetPath)) { WriteLine("A source .pre file was not specified"); return(1); } var preset = new FileInfo(presetPath); if (!preset.Exists) { WriteLine("The preset was not found"); return(1); } var target = new FileInfo(targetPath); Amplifire.ExtractCab(preset, target); return(0); }
private int RunCommand() { var target = _target.Value(); if (string.IsNullOrWhiteSpace(target)) { WriteLine("A target .abu file was not specified"); return(1); } var dirFiles = from path in _dirs.Values ?? Enumerable.Empty <string>() let di = new DirectoryInfo(path) from fi in di.EnumerateFiles("*.pre") select fi; var files = (from path in _files.Values select new FileInfo(path)) .Concat(dirFiles).ToArray(); if (!files.Any()) { WriteLine("No preset files were specified"); return(1); } using (var s = File.OpenWrite(target)) { var offset = 0; if (_offset.HasValue()) { offset = int.Parse(_offset.Value()); } Amplifire.PackagePresets(files, s, offset); return(0); } }
private int RunCommand() { var preset = _file.Value(); if (string.IsNullOrWhiteSpace(preset)) { WriteLine("A preset file was not specified"); return(1); } var target = _target.Value(); if (string.IsNullOrWhiteSpace(target)) { WriteLine("A target .abu file was not specified"); return(1); } var predef = File.ReadAllText(preset); using (var output = File.OpenWrite(target)) Amplifire.SetEveryPreset(predef, output); return(0); }