protected override void Execute() { if (string.IsNullOrWhiteSpace(Type)) { throw new CommandException("Please specify the type to export using the parameter: --type=XYZ"); } if (string.IsNullOrWhiteSpace(FilePath)) { throw new CommandException("Please specify the full path and name of the export file using the parameter: --filePath=XYZ"); } Log.Debug("Finding exporter '" + Type + "'"); var exporter = exporterLocator.Find(Type, Repository, FileSystem, Log); if (exporter == null) { throw new CommandException("Error: Unrecognized exporter '" + Type + "'"); } Log.Debug("Beginning the export"); exporter.Export(string.Format("FilePath={0}", FilePath), string.Format("Project={0}", Project), string.Format("Name={0}", Name), string.Format("ReleaseVersion={0}", ReleaseVersion)); }
protected override Task Execute() { commandOutputProvider.Warning($"The {AssemblyExtensions.GetExecutableName()} import/export commands have been deprecated. See https://g.octopushq.com/DataMigration for alternative options."); if (string.IsNullOrWhiteSpace(Type)) { throw new CommandException("Please specify the type to export using the parameter: --type=XYZ"); } if (string.IsNullOrWhiteSpace(FilePath)) { throw new CommandException("Please specify the full path and name of the export file using the parameter: --filePath=XYZ"); } commandOutputProvider.Debug("Finding exporter '{Type:l}'", Type); var exporter = exporterLocator.Find(Type, Repository, FileSystem, commandOutputProvider); if (exporter == null) { throw new CommandException("Error: Unrecognized exporter '" + Type + "'"); } commandOutputProvider.Debug("Beginning the export"); return(exporter.Export(string.Format("FilePath={0}", FilePath), string.Format("Project={0}", Project), string.Format("Name={0}", Name), string.Format("ReleaseVersion={0}", ReleaseVersion))); }