Skip to content

Commit d55847e

Browse files
committed
Check if files are there during publish
1 parent 8470e1c commit d55847e

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

Sdk/Tasks/DmappCreation.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public override bool Execute()
111111
string baseLocation = BaseOutputPath;
112112
if (!FileSystem.Instance.Path.IsPathRooted(BaseOutputPath))
113113
{
114-
// Relative path (starting from project directory
114+
// Relative path (starting from project directory)
115115
baseLocation = FileSystem.Instance.Path.GetFullPath(FileSystem.Instance.Path.Combine(preparedData.Project.ProjectDirectory, BaseOutputPath));
116116
}
117117

Sdk/Tasks/PublishToCatalog.cs

+15-4
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,31 @@ public override bool Execute()
6262
return true;
6363
}
6464

65-
// Zip the CatalogInformation if it exists.
6665
var fs = FileSystem.Instance;
6766

68-
// Store zip in bin\{Debug/Release} folder, similar like nupkg files.
67+
// Package & zip are stored in bin\{Debug/Release} folder, similar like nupkg files.
6968
string baseLocation = BaseOutputPath;
7069
if (!fs.Path.IsPathRooted(BaseOutputPath))
7170
{
72-
// Relative path (starting from project directory
71+
// Relative path (starting from project directory)
7372
baseLocation = fs.Path.GetFullPath(fs.Path.Combine(ProjectDirectory, BaseOutputPath));
7473
}
7574

76-
string packagePath = FileSystem.Instance.Path.Combine(baseLocation, Configuration, $"{PackageId}.{PackageVersion}.dmapp");
75+
string packagePath = fs.Path.Combine(baseLocation, Configuration, $"{PackageId}.{PackageVersion}.dmapp");
7776
string catalogInfoPath = fs.Path.Combine(baseLocation, Configuration, $"{PackageId}.{PackageVersion}.CatalogInformation.zip");
7877

78+
if (!fs.File.Exists(packagePath))
79+
{
80+
Log.LogError($"Package '{PackageId}' was not found on expected location: {packagePath}");
81+
return false;
82+
}
83+
84+
if (!fs.File.Exists(catalogInfoPath))
85+
{
86+
Log.LogError($"CatalogInformation was not found on expected location: {catalogInfoPath}");
87+
return false;
88+
}
89+
7990
Log.LogMessage($"Found Package: {packagePath}.");
8091
Log.LogMessage($"Found Catalog Information: {catalogInfoPath}.");
8192

0 commit comments

Comments
 (0)