Skip to content

Commit

Permalink
minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
dnenov committed Oct 30, 2023
1 parent a35b294 commit f993ed8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,12 @@ private void ClearAllEntries()
this.BuildVersion = "0";
this.ErrorString = string.Empty;
this.Uploading = false;
this.UploadHandle = null;
// Clearing the UploadHandle when using Submit currently throws - check trheading
try
{
this.UploadHandle = null;
}
catch { Exception ex; }
this.IsNewVersion = false;
this.MoreExpanded = false;
this.UploadState = PackageUploadHandle.State.Ready;
Expand Down Expand Up @@ -1779,9 +1784,6 @@ private void Submit()
var contentFiles = BuildPackage();
try
{
//set the IsNewPackage to true temporarily
IsNewVersion = true;

//if buildPackage() returns no files then the package
//is empty so we should return
if (contentFiles == null || contentFiles.Count() < 1)
Expand Down
5 changes: 3 additions & 2 deletions src/DynamoPackages/PackageDirectoryBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace Dynamo.PackageManager
public interface IPackageDirectoryBuilder
{
IDirectoryInfo BuildDirectory(Package packages, string packagesDirectory, IEnumerable<string> files, IEnumerable<string> markdownfiles);
IDirectoryInfo BuildRetainDirectory(Package package, string packagesDirectory, IEnumerable<IEnumerable<string>> contentFiles, IEnumerable<string> markdownFiles);
}

/// <summary>
Expand Down Expand Up @@ -65,7 +66,7 @@ public IDirectoryInfo BuildDirectory(Package package, string packagesDirectory,
return rootDir;
}

public IDirectoryInfo BuildRetainDirectory(Package package, string packagesDirectory, List<List<String>> contentFiles, IEnumerable<string> markdownFiles)
public IDirectoryInfo BuildRetainDirectory(Package package, string packagesDirectory, IEnumerable<IEnumerable<string>> contentFiles, IEnumerable<string> markdownFiles)
{

var rootPath = Path.Combine(packagesDirectory, package.Name);
Expand Down Expand Up @@ -205,7 +206,7 @@ private void WritePackageHeader(Package package, IDirectoryInfo rootDir)
fileSystem.WriteAllText(headerPath, pkgHeaderStr);
}

internal void CopyFilesIntoRetainedPackageDirectory(List<List<String>> contentFiles, IEnumerable<string> markdownFiles, IDirectoryInfo rootDir, out List<string> dyfFiles)
internal void CopyFilesIntoRetainedPackageDirectory(IEnumerable<IEnumerable<string>> contentFiles, IEnumerable<string> markdownFiles, IDirectoryInfo rootDir, out List<string> dyfFiles)
{
dyfFiles = new List<string>();

Expand Down

0 comments on commit f993ed8

Please sign in to comment.