File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -149,9 +149,12 @@ else
149149 RELEASE_INFO=" {}"
150150fi
151151
152- if [ -f $TMP_DIR /Procfile ]; then
153- # update release info with data from the Procfile
154- RELEASE_INFO=$( cat $TMP_DIR /Procfile | /app/bin/yaml2json-procfile)
152+ if [ " $RELEASE_INFO " == " {}" ]; then
153+ if [ -f $TMP_DIR /Procfile ]; then
154+ # fall back to Procfile if there's no default process types
155+ # FIXME: refactor into slugbuilder
156+ RELEASE_INFO=$( cat $TMP_DIR /Procfile | /app/bin/yaml2json-procfile)
157+ fi
155158fi
156159
157160puts-step " Launching... "
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ func ParseReleaseVersion(bytes []byte) (int, error) {
7171
7272func GetDefaultType (bytes []byte ) (string , error ) {
7373 type YamlTypeMap struct {
74- DefaultProcessTypes ProcessType
74+ DefaultProcessTypes ProcessType `default_process_types`
7575 }
7676
7777 var p YamlTypeMap
@@ -80,7 +80,7 @@ func GetDefaultType(bytes []byte) (string, error) {
8080 return "" , err
8181 }
8282
83- retVal , err := json .Marshal (& p )
83+ retVal , err := json .Marshal (& p . DefaultProcessTypes )
8484
8585 if err != nil {
8686 return "" , err
Original file line number Diff line number Diff line change @@ -121,8 +121,11 @@ default_process_types:
121121 if err != nil {
122122 t .Error (err )
123123 }
124- if defaultType == "" {
125- t .Error ("default type cannot be empty" )
124+ if defaultType != `{"web":"while true; do echo hello; sleep 1; done"}` && string (data ) != "" {
125+ t .Errorf ("incorrect default type, got %s" , defaultType )
126+ }
127+ if string (data ) == "" && defaultType != "{}" {
128+ t .Errorf ("incorrect default type, got %s" , defaultType )
126129 }
127130 }
128131}
You can’t perform that action at this time.
0 commit comments