~artemis/cap

42c77111d5a673efb09ea9f080c9fbdd38f5045e — Artémis 1 year, 7 months ago 66e889f v0.3.1
added better post-build logs
1 files changed, 11 insertions(+), 1 deletions(-)

M builder.go
M builder.go => builder.go +11 -1
@@ 250,12 250,22 @@ func (f *FsBuilder) RunPostBuildCommands() bool {
	domain.L.Infof("Running %d post-build commands...", cmdCount)

	for _, cmd := range f.Config.PostBuild.Commands {
		before := time.Now()
		err := f.RunPostBuildCommand(&globalTimeout, cmd)
		if err != nil {
			domain.L.Errorf("Error obtained while running post-build command `%s`\n%v", cmd, err)
			return false
		}
		print(".")
		after := time.Since(before)

		var afterLabel string
		if after.Milliseconds() < 1_000 {
			afterLabel = fmt.Sprintf("%dms", after.Milliseconds())
		} else {
			afterLabel = fmt.Sprintf("%ds %dms", int(after.Seconds()), after.Milliseconds()%1_000)
		}

		domain.L.Infof("- [%s] %s", cmd, afterLabel)
	}

	println()