@@ -11,6 +11,8 @@ import (
1111
1212 "github.com/alecthomas/template"
1313 helpers "github.com/devopsdays/devopsdays-cli/helpers"
14+ paths "github.com/devopsdays/devopsdays-cli/helpers/paths"
15+ "github.com/devopsdays/devopsdays-cli/images"
1416 "github.com/devopsdays/devopsdays-cli/model"
1517 "github.com/fatih/color"
1618 survey "gopkg.in/AlecAivazis/survey.v1"
@@ -155,10 +157,10 @@ func CreateEvent(city, year string) (err error) {
155157 return
156158 }
157159
158- orgEmail := []string {"organizers-" , strings .Replace (strings .TrimSpace (strings .ToLower (helpers . CityClean (city ))), " " , "-" , 10 ), "-" , strings .TrimSpace (year ), "@devopsdays.org" }
159- proposalEmail := []string {"proposals-" , helpers . CityClean (city ), "-" , strings .TrimSpace (year ), "@devopsdays.org" }
160+ orgEmail := []string {"organizers-" , strings .Replace (strings .TrimSpace (strings .ToLower (CityClean (city ))), " " , "-" , 10 ), "-" , strings .TrimSpace (year ), "@devopsdays.org" }
161+ proposalEmail := []string {"proposals-" , CityClean (city ), "-" , strings .TrimSpace (year ), "@devopsdays.org" }
160162 myEvent := model.Event {
161- Name : strings .Join ([]string {strings .TrimSpace (year ), "-" , helpers . CityClean (city )}, "" ),
163+ Name : strings .Join ([]string {strings .TrimSpace (year ), "-" , CityClean (city )}, "" ),
162164 Year : year ,
163165 City : city ,
164166 EventTwitter : answers .Twitter ,
@@ -173,14 +175,14 @@ func CreateEvent(city, year string) (err error) {
173175 ProposalEmail : strings .Join (proposalEmail , "" ),
174176 }
175177
176- NewEvent (myEvent , helpers . CityClean (city ), year )
178+ NewEvent (myEvent , CityClean (city ), year )
177179
178180 if answers .LogoPath != "" {
179- err = EventLogo (answers .LogoPath , helpers . CityClean (city ), year )
181+ err = EventLogo (answers .LogoPath , CityClean (city ), year )
180182 }
181183
182184 if answers .SquareLogoPath != "" {
183- err = EventLogoSquare (answers .SquareLogoPath , helpers . CityClean (city ), year )
185+ err = EventLogoSquare (answers .SquareLogoPath , CityClean (city ), year )
184186 }
185187
186188 return
@@ -195,23 +197,23 @@ func NewEvent(event model.Event, city string, year string) (err error) {
195197 log .Fatal ("Parse: " , err )
196198 return
197199 }
198- f , err := os .Create (helpers .EventDataPath (helpers .GetWebdir (), city , year ))
200+ f , err := os .Create (paths .EventDataPath (paths .GetWebdir (), city , year ))
199201 defer f .Close ()
200202 t .Execute (f , event )
201203
202204 if err != nil {
203205 fmt .Println (err )
204206 } else {
205207 fmt .Fprintf (color .Output , "\n \n \n Created event file for %s\n " , color .GreenString (event .City ))
206- fmt .Fprintf (color .Output , "at %s\n \n \n " , color .BlueString (helpers .EventDataPath (helpers .GetWebdir (), city , year )))
208+ fmt .Fprintf (color .Output , "at %s\n \n \n " , color .BlueString (paths .EventDataPath (paths .GetWebdir (), city , year )))
207209 }
208210 return
209211}
210212
211213// EventLogo takes in a path to an event's main logo and copies/renames it to the proper destination
212214func EventLogo (srcPath , city , year string ) (err error ) {
213215
214- eventStaticPath , err := helpers .EventStaticPath (city , year )
216+ eventStaticPath , err := paths .EventStaticPath (city , year )
215217 if err != nil {
216218 log .Fatal (err )
217219 }
@@ -227,12 +229,12 @@ func EventLogo(srcPath, city, year string) (err error) {
227229
228230// EventLogoSquare takes in a path the event's square logo, and crops/resizes it and copies it to the proper destination
229231func EventLogoSquare (srcPath , city , year string ) (err error ) {
230- eventStaticPath , err := helpers .EventStaticPath (city , year )
232+ eventStaticPath , err := paths .EventStaticPath (city , year )
231233 if err != nil {
232234 log .Fatal (err )
233235 }
234236 destPath := filepath .Join (eventStaticPath , "logo-square.png" )
235- helpers .ResizeImage (srcPath , destPath , "png" , 600 , 600 )
237+ images .ResizeImage (srcPath , destPath , "png" , 600 , 600 )
236238
237239 // @TODO update helpers.ResizeImage to return error code and do something with it here
238240
0 commit comments