diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2015-11-23 16:32:06 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2015-11-23 16:32:06 +0100 |
commit | 831e936846920b395dddd584b76e2b9f6b7c18a1 (patch) | |
tree | ac6a43821e195186cbae008e3965643236b23d5d /commands/server.go | |
parent | 098a0c819af2575628690517f4bd40253d7436d7 (diff) |
Improve "watching for ..." logging
Diffstat (limited to 'commands/server.go')
-rw-r--r-- | commands/server.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/commands/server.go b/commands/server.go index 708912fbb..57f96a1bd 100644 --- a/commands/server.go +++ b/commands/server.go @@ -150,14 +150,15 @@ func server(cmd *cobra.Command, args []string) { // Watch runs its own server as part of the routine if serverWatch { - watched := getDirList() - workingDir := helpers.AbsPathify(viper.GetString("WorkingDir")) - for i, dir := range watched { - watched[i], _ = helpers.GetRelativePath(dir, workingDir) + watchDirs := getDirList() + baseWatchDir := helpers.AbsPathify(viper.GetString("WorkingDir")) + for i, dir := range watchDirs { + watchDirs[i], _ = helpers.GetRelativePath(dir, baseWatchDir) } - unique := strings.Join(helpers.RemoveSubpaths(watched), ",") - jww.FEEDBACK.Printf("Watching for changes in %s/{%s}\n", workingDir, unique) + rootWatchDirs := strings.Join(helpers.UniqueStrings(helpers.ExtractRootPaths(watchDirs)), ",") + + jww.FEEDBACK.Printf("Watching for changes in %s/{%s}\n", baseWatchDir, rootWatchDirs) err := NewWatcher(serverPort) if err != nil { fmt.Println(err) |