diff options
Diffstat (limited to 'commands/server.go')
-rw-r--r-- | commands/server.go | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/commands/server.go b/commands/server.go index 5d50ebe2c..ade8da5e8 100644 --- a/commands/server.go +++ b/commands/server.go @@ -256,15 +256,11 @@ func (sc *serverCmd) server(cmd *cobra.Command, args []string) error { return err } - baseWatchDir := c.Cfg.GetString("workingDir") - relWatchDirs := make([]string, len(watchDirs)) - for i, dir := range watchDirs { - relWatchDirs[i], _ = helpers.GetRelativePath(dir, baseWatchDir) - } - - rootWatchDirs := strings.Join(helpers.UniqueStrings(helpers.ExtractRootPaths(relWatchDirs)), ",") + watchGroups := helpers.ExtractAndGroupRootPaths(watchDirs) - jww.FEEDBACK.Printf("Watching for changes in %s%s{%s}\n", baseWatchDir, helpers.FilePathSeparator, rootWatchDirs) + for _, group := range watchGroups { + jww.FEEDBACK.Printf("Watching for changes in %s\n", group) + } watcher, err := c.newWatcher(watchDirs...) if err != nil { @@ -279,6 +275,15 @@ func (sc *serverCmd) server(cmd *cobra.Command, args []string) error { } +func getRootWatchDirsStr(baseDir string, watchDirs []string) string { + relWatchDirs := make([]string, len(watchDirs)) + for i, dir := range watchDirs { + relWatchDirs[i], _ = helpers.GetRelativePath(dir, baseDir) + } + + return strings.Join(helpers.UniqueStringsSorted(helpers.ExtractRootPaths(relWatchDirs)), ",") +} + type fileServer struct { baseURLs []string roots []string |