dependency-watch
dependency-watch copied to clipboard
Need of visual feedback it's doing stuff.
With the --watch option, the things can hang for many minutes and as anxious as I am, I'd be relieved if it could take one more line saying when the last check happen.
Right now I have
$ dependency-watch notify --watch --data watched-deps deps-watch.toml
# nothing forever
Need
$ dependency-watch notify --watch --data watched-deps deps-watch.toml
Last checked at 2022-02-17 14:05:23
With this "last checked" row refreshing itself.
Yes, good idea.
I can do something quick like
index 6a298c5..5ae5d47 100644
--- src/main/kotlin/watch/dependency/dependencyAwait.kt
+++ src/main/kotlin/watch/dependency/dependencyAwait.kt
class DependencyAwait(
private val mavenRepository: MavenRepository,
@@ -23,10 +27,20 @@ class DependencyAwait(
break
}
+ print("Last checked at ${formatter.format(Instant.now())}. Next check in ${checkInterval.inWholeSeconds} seconds.\r")
+
debug.log { "Sleeping $checkInterval..." }
delay(checkInterval)
}
+ println("Metadata fetched at ${formatter.format(Instant.now())}")
+
versionNotifier.notify(mavenRepository.name, coordinate, version)
}
+
+ companion object {
+ private val formatter by lazy(NONE) {
+ DateTimeFormatter.ofPattern("HH:mm:ss").withZone(ZoneId.systemDefault())
+ }
+ }
}
Would you rather have another method in VersionNotifier, or another notifier ?
Let's get it done Jake. We need this feature!