func (s *serveCmd) run() error { repoPath, err := filepath.Abs(s.repoPath) if err != nil { return err } if _, err := os.Stat(repoPath); os.IsNotExist(err) { return err } fmt.Fprintf(s.out, "Now serving you on %s\n", s.address) return repo.StartLocalRepo(repoPath, s.address) }
func serve(cmd *cobra.Command, args []string) error { repoPath, err := filepath.Abs(repoPath) if err != nil { return err } if _, err := os.Stat(repoPath); os.IsNotExist(err) { return err } repo.StartLocalRepo(repoPath) return nil }
func (s *serveCmd) run() error { repoPath, err := filepath.Abs(s.repoPath) if err != nil { return err } if _, err := os.Stat(repoPath); os.IsNotExist(err) { return err } fmt.Fprintln(s.out, "Regenerating index. This may take a moment.") if err := index(repoPath, "http://"+s.address, ""); err != nil { return err } fmt.Fprintf(s.out, "Now serving you on %s\n", s.address) return repo.StartLocalRepo(repoPath, s.address) }
func serve(cmd *cobra.Command, args []string) { repo.StartLocalRepo(localRepoDirectory()) }