@@ -255,27 +255,25 @@ func Uninitialize() (string, error) {
255255}
256256
257257//Clean removes any event or metrics files from project in the current working directory
258- func Clean (dr util.DateRange , terminalOnly bool ) ( string , error ) {
258+ func Clean (dr util.DateRange , terminalOnly bool ) error {
259259 wd , err := os .Getwd ()
260260 if err != nil {
261- return "" , err
261+ return err
262262 }
263263
264264 projRoot , err := scm .RootPath (wd )
265265 if err != nil {
266- return "" , fmt .Errorf (
267- "Unable to clean, Git repository not found in %s" , projRoot )
266+ return fmt .Errorf ("Unable to clean, Git repository not found in %s" , projRoot )
268267 }
269268
270269 gtmPath := filepath .Join (projRoot , GTMDir )
271270 if _ , err := os .Stat (gtmPath ); os .IsNotExist (err ) {
272- return "" , fmt .Errorf (
273- "Unable to clean GTM data, %s directory not found" , gtmPath )
271+ return fmt .Errorf ("Unable to clean GTM data, %s directory not found" , gtmPath )
274272 }
275273
276274 files , err := ioutil .ReadDir (gtmPath )
277275 if err != nil {
278- return "" , err
276+ return err
279277 }
280278 for _ , f := range files {
281279 if ! strings .HasSuffix (f .Name (), ".event" ) &&
@@ -289,18 +287,21 @@ func Clean(dr util.DateRange, terminalOnly bool) (string, error) {
289287 if terminalOnly && strings .HasSuffix (f .Name (), ".event" ) {
290288 b , err := ioutil .ReadFile (fp )
291289 if err != nil {
292- return "" , err
290+ return err
293291 }
294292 if ! strings .Contains (string (b ), "terminal.app" ) {
295293 continue
296294 }
297295 }
298296 if err := os .Remove (fp ); err != nil {
299- return "" , err
297+ return err
300298 }
301299 }
300+ return nil
301+ }
302302
303- return "" , nil
303+ func Stash () error {
304+ return nil
304305}
305306
306307// Paths returns the root git repo and gtm paths
0 commit comments