github.com/LGUG2Z/story@v0.4.1/cli/artifacts.go (about) 1 package cli 2 3 import ( 4 "fmt" 5 6 "github.com/LGUG2Z/story/manifest" 7 "github.com/spf13/afero" 8 "github.com/urfave/cli" 9 ) 10 11 func ArtifactsCmd(fs afero.Fs) cli.Command { 12 return cli.Command{ 13 Name: "artifacts", 14 Usage: "Shows a list of artifacts to be built and deployed for the current story", 15 Action: func(c *cli.Context) error { 16 if !isStory { 17 return ErrNotWorkingOnAStory 18 } 19 20 if c.Args().Present() { 21 return ErrCommandTakesNoArguments 22 } 23 24 story, err := manifest.LoadStory(fs) 25 if err != nil { 26 return err 27 } 28 29 for project := range story.Artifacts { 30 if story.Artifacts[project] { 31 fmt.Println(project) 32 } 33 } 34 35 return nil 36 }, 37 } 38 }