Skip to content

Commit

Permalink
Improve docs and logs
Browse files Browse the repository at this point in the history
  • Loading branch information
albertwoo committed Oct 19, 2023
1 parent 884fa4f commit 2bbc71f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## [Unreleased]

## [1.0.2] - 2023-10-19

- Improve docs
- Improve logs

## [1.0.1] - 2023-10-19

- Add failIfNoActiveSubStage to stage
Expand Down
7 changes: 7 additions & 0 deletions Fun.Build/Changelog.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ open System.Text

type Changelog =

/// <summary>
/// Get latest version info from the CHANGELOG.md file
/// </summary>
/// <param name="directory">Directory which contains the changelog file</param>
/// <param name="changelogFileName">Default is CHANGELOG.md</param>
/// <param name="isPreview">Check if the line contains keyword 'preview'</param>
/// <param name="isValidVersion">By default always return true</param>
static member GetLastVersion(directory, ?changelogFileName, ?isPreview, ?isValidVersion) =
let changelogFileName = defaultArg changelogFileName "CHANGELOG.md"
let lines = File.ReadLines(Path.Combine(directory, changelogFileName)).GetEnumerator()
Expand Down
5 changes: 4 additions & 1 deletion Fun.Build/StageContextExtensions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ module StageContextExtensionsInternal =
| Step.StepOfStage s -> s.IsActive { s with ParentContext = parentContext }
| _ -> false
)
if not hasActiveStep then raise (PipelineFailedException "No active sub stages")
if not hasActiveStep then
AnsiConsole.MarkupLineInterpolated
$"[red]Pipeline is failed because there is no active sub stages but stage ({stage.GetNamePath()}) requires at least one[/]"
raise (PipelineFailedException "No active sub stages")

let stageSW = Stopwatch.StartNew()
let isParallel = stage.IsParallel stage
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Every **step** is just a **async<Result<unit, string>>**, string is for the erro
## Minimal example and conventions

```fsharp
#r "nuget: Fun.Build, 1.0.1"
#r "nuget: Fun.Build, 1.0.2"
open Fun.Build
pipeline "demo" {
Expand Down Expand Up @@ -66,7 +66,7 @@ dotnet fsi build.fsx -- -p your_pipeline -h
Below example covered most of the apis and usage example, take it as the documents😊:

```fsharp
#r "nuget: Fun.Build, 1.0.1"
#r "nuget: Fun.Build, 1.0.2"
open Fun.Result
open Fun.Build
Expand Down

0 comments on commit 2bbc71f

Please sign in to comment.