Beispiel #1
0
        private RepositoryMigrator(LogService logService, IRepositoryMigrator repositoryMigrator, string basePath, Uri repositoryUrl)
        {
            this.logService         = logService;
            this.repositoryMigrator = repositoryMigrator;
            this.basePath           = basePath;
            this.repositoryPath     = DirectoryUtility.Prepare(basePath, CremaString.Repository);
            if (repositoryUrl == null)
            {
                this.sourceUrl = new Uri(Path.Combine(this.basePath, nameString));
            }
            else if (repositoryUrl.IsAbsoluteUri)
            {
                this.sourceUrl = repositoryUrl;
            }
            else
            {
                this.sourceUrl = UriUtility.Combine(new Uri(this.basePath), nameString, repositoryUrl.ToString());
            }

            this.sourceRootUrl     = new Uri(this.Run($"info \"{this.sourceUrl}\" --show-item repos-root-url").Trim());
            this.sourceRelativeUrl = UriUtility.MakeRelativeString(this.sourceRootUrl, this.sourceUrl);
        }