Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var App = &cli.App{ Name: "monodiff", Usage: "Simple tool to detect modified part of monorepo", Flags: []cli.Flag{ &cli.StringFlag{ Name: "prefix", Value: "", Usage: "Prefix of output line", }, &cli.StringFlag{ Name: "suffix", Value: "", Usage: "Suffix of output line", }, &cli.StringFlag{ Name: "separator", Value: "", Usage: "Path separator of output line", }, }, Action: func(c *cli.Context) error { prefix := c.String("prefix") suffix := c.String("suffix") separator := c.String("separator") spec, err := loadSpec() if err != nil { return err } changedFiles := []string{} stdin := bufio.NewScanner(os.Stdin) for stdin.Scan() { text := stdin.Text() if text != "" { changedFiles = append(changedFiles, text) } } changedProjects, err := detectChanges(spec, changedFiles) for _, changedProject := range changedProjects { name := changedProject.Name if separator != "" { name = strings.ReplaceAll(name, "/", separator) } fmt.Println(prefix + name + suffix) } return nil }, }
App is a CLI app of monodiff using urfave/cli/v2.
Functions ¶
This section is empty.
Types ¶
type FilesDependency ¶
type FilesDependency struct {
GlobPattern string
}
FilesDependency represents dependency to files.
type Project ¶
type Project struct { Name string FilesDependencies []FilesDependency ProjectDependencies []ProjectDependency }
Project represents unit of build.
type ProjectDependency ¶
type ProjectDependency struct {
ProjectName string
}
ProjectDependency represents dependency to other project.
type ProjectJSON ¶
type ProjectJSON struct {
Deps []string `json:"deps"`
}
ProjectJSON represents a project configuration in monodiff.json
Click to show internal directories.
Click to hide internal directories.