private static void EnsureOptionsCompatibility(CloneCommandLineOptions options) { if ((string.IsNullOrWhiteSpace(options.RepoUri) && !string.IsNullOrWhiteSpace(options.Version)) || (!string.IsNullOrWhiteSpace(options.RepoUri) && string.IsNullOrWhiteSpace(options.Version))) { throw new ArgumentException($"Either specify both repo and version to clone a specific remote repo, or neither to clone all dependencies from this repo."); } if (string.IsNullOrWhiteSpace(options.ReposFolder)) { options.ReposFolder = Environment.CurrentDirectory; } if (!Directory.Exists(options.ReposFolder)) { Directory.CreateDirectory(options.ReposFolder); } }
public CloneOperation(CloneCommandLineOptions options) : base(options) { _options = options; }