Skip to content

Commit

Permalink
Merge pull request #47 from criticalmanufacturing/main-36-bump-comman…
Browse files Browse the repository at this point in the history
…d-showing-wrong-message

fix: #36 bump command showing wrong message
  • Loading branch information
joaoopereira authored Oct 15, 2021
2 parents 54d213b + a5790ba commit 4ee11b3
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 16 deletions.
14 changes: 8 additions & 6 deletions cmf-cli/Commands/bump/BumpCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,10 @@ public void Execute(CmfPackage cmfPackage, string version, string buildNr, strin
// TODO :: Uncomment if the cmfpackage.json support build number
// dependency.Version = GenericUtilities.RetrieveNewVersion(dependency.Version, version, buildNr);

dependency.Version = !string.IsNullOrWhiteSpace(version) ? version : dependency.Version;

if (subCmfPackageWithDependency != null)
{
Execute(subCmfPackageWithDependency, version, buildNr, root, all);
dependency.Version = !string.IsNullOrWhiteSpace(version) ? version : dependency.Version;
}
else
{
Expand All @@ -137,18 +136,21 @@ public void Execute(CmfPackage cmfPackage, string version, string buildNr, strin
// TODO :: Uncomment if the cmfpackage.json support build number
// dependency.Version = GenericUtilities.RetrieveNewVersion(dependency.Version, version, buildNr);

dependency.Version = !string.IsNullOrWhiteSpace(version) ? version : dependency.Version;

if (subCmfPackageWithDependency != null)
{
Execute(subCmfPackageWithDependency, version, buildNr, root, all);
Execute(subCmfPackageWithDependency, version, buildNr, root, all);
dependency.Version = !string.IsNullOrWhiteSpace(version) ? version : dependency.Version;
}
else
{
Log.Warning($"Dependency {dependency.Id}.{dependency.Version} not found");
}
}
}
}

// will save with new version
cmfPackage.SaveCmfPackage();

#endregion
}
}
Expand Down
7 changes: 2 additions & 5 deletions cmf-cli/Handlers/PackageType/PackageTypeHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace Cmf.Common.Cli.Handlers
public abstract class PackageTypeHandler : IPackageTypeHandler
{
#region Protected Properties

/// <summary>
/// the underlying file system
/// </summary>
Expand Down Expand Up @@ -71,6 +72,7 @@ public abstract class PackageTypeHandler : IPackageTypeHandler
/// </summary>
/// <exception cref="CliException"></exception>
public PackageTypeHandler(CmfPackage cmfPackage) : this(cmfPackage, new FileSystem()) { }

/// <summary>
/// Initializes a new instance of the <see cref="PackageTypeHandler" /> class.
/// </summary>
Expand Down Expand Up @@ -298,7 +300,6 @@ internal virtual void FinalArchive(IDirectoryInfo packageOutputDir, IDirectoryIn
this.fileSystem.File.Move(tempzipPath, destZipPath, true);
}


/// <summary>
/// Get Content To pack
/// </summary>
Expand Down Expand Up @@ -463,9 +464,6 @@ public virtual void Bump(string version, string buildNr, Dictionary<string, obje
CmfPackage.SetVersion(!string.IsNullOrWhiteSpace(version) ? version : CmfPackage.Version);

Log.Information($"Will bump {CmfPackage.PackageId} from version {currentVersion} to version {CmfPackage.Version}");

// will save with new version
CmfPackage.SaveCmfPackage();
}
}

Expand Down Expand Up @@ -501,6 +499,5 @@ public virtual void Pack(IDirectoryInfo packageOutputDir, IDirectoryInfo outputD
}

#endregion

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public override void Bump(string version, string buildNr, Dictionary<string, obj

if (jsonObj["version"] == null)
{
throw new CliException(string.Format(CliMessages.MissingMandatoryProperty, "version", fileName));
throw new CliException(string.Format(CliMessages.MissingMandatoryPropertyInFile, "version", fileName));
}

jsonObj["version"] = GenericUtilities.RetrieveNewPresentationVersion(jsonObj["version"].ToString(), version, buildNr);
Expand Down
2 changes: 1 addition & 1 deletion cmf-cli/cmf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<DefaultDocumentationFileNameMode>Name</DefaultDocumentationFileNameMode>
<DefaultDocumentationNestedTypeVisibility>Namespace</DefaultDocumentationNestedTypeVisibility>
<DefaultDocumentationGeneratedPages>Namespaces</DefaultDocumentationGeneratedPages>
<Version>1.1.1</Version>
<Version>1.1.2</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion npm/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion npm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@criticalmanufacturing/cli",
"version": "1.1.1",
"version": "1.1.2",
"description": "Critical Manufacturing command line client",
"bin": {
"cmf": "./run.js"
Expand Down
1 change: 0 additions & 1 deletion tests/tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@
<ItemGroup>
<ProjectReference Include="..\cmf-cli\cmf.csproj" />
</ItemGroup>

</Project>

0 comments on commit 4ee11b3

Please sign in to comment.