@@ -56,7 +56,7 @@ func (d *DryccCmd) BuildsInfo(appID string, version int) error {
5656}
5757
5858// BuildsCreate creates a build for an app.
59- func (d * DryccCmd ) BuildsCreate (appID , image , stack , procfile , dryccfile , confirm string ) error {
59+ func (d * DryccCmd ) BuildsCreate (appID , image , stack , procfile , dryccpath , confirm string ) error {
6060 s , appID , err := load (d .ConfigFile , appID )
6161
6262 if err != nil {
@@ -76,13 +76,8 @@ func (d *DryccCmd) BuildsCreate(appID, image, stack, procfile, dryccfile, confir
7676 }
7777
7878 dryccfileMap := make (map [string ]interface {})
79- if _ , err := os .Stat (dryccfile ); err == nil {
80- contents , err := os .ReadFile (dryccfile )
81- if err != nil {
82- return err
83- }
84-
85- if dryccfileMap , err = parseDryccfile (contents ); err != nil {
79+ if info , err := os .Stat (dryccpath ); err == nil && info .IsDir () {
80+ if dryccfileMap , err = drycc .ParseDryccfile (dryccpath ); err != nil {
8681 return err
8782 }
8883 }
@@ -110,11 +105,6 @@ func parseProcfile(procfile []byte) (map[string]string, error) {
110105 return procfileMap , yaml .Unmarshal (procfile , & procfileMap )
111106}
112107
113- func parseDryccfile (dryccfile []byte ) (map [string ]interface {}, error ) {
114- dryccfileMap := make (map [string ]interface {})
115- return dryccfileMap , yaml .Unmarshal (dryccfile , & dryccfileMap )
116- }
117-
118108func buildConfirmAction (c * drycc.Client , appID string , procfileMap map [string ]string ,
119109 dryccfileMap map [string ]interface {}, confirm string ) error {
120110
@@ -123,7 +113,7 @@ func buildConfirmAction(c *drycc.Client, appID string, procfileMap map[string]st
123113 if ((len (build .Procfile ) != 0 && len (procfileMap ) == 0 ) || (len (build .Dryccfile ) != 0 && len (dryccfileMap ) == 0 )) && (confirm == "" || confirm != "yes" ) {
124114 // hint
125115 fmt .Printf (` ! WARNING: Potentially Build Create Action
126- ! The Procfile or drycc.yaml is empty, not last time
116+ ! The Procfile or drycc file is empty, not last time
127117 ! To proceed, type "yes" !
128118
129119> ` )
0 commit comments