Skip to content

Commit

Permalink
[TT-808] add method that removes .run.id (#814)
Browse files Browse the repository at this point in the history
* add method to remove .run.id
  • Loading branch information
Tofel authored Jan 11, 2024
1 parent 3e60bbc commit 5c1a636
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions utils/runid/run_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,29 @@ func GetOrGenerateRunId() (string, error) {

return runId, nil
}

func RemoveLocalRunId() error {
_, inOs := os.LookupEnv("RUN_ID")
if inOs {
return nil
}

workingDir, err := os.Getwd()
if err != nil {
return err
}

possiblePath := workingDir + "/.run.id"
_, err = os.Stat(possiblePath)

if err != nil {
return err
}

err = os.Remove(possiblePath)
if err != nil {
return err
}

return nil
}

0 comments on commit 5c1a636

Please sign in to comment.