Skip to content

Commit

Permalink
- Adding the business layer
Browse files Browse the repository at this point in the history
  • Loading branch information
matang28 committed May 5, 2019
1 parent bcd9d56 commit 0859208
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pkg/script_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@ import (

const replyFile = "reply.json"

func Reply(data interface{}) error {
pwd, err := os.Getwd()
if err != nil {
return err
}
func Reply(projectPath string, data interface{}) error {

bytes, err := json.Marshal(data)
if err != nil {
return err
}

destPath := filepath.Join(pwd, replyFile)
destPath := filepath.Join(projectPath, replyFile)
if err = ioutil.WriteFile(destPath, bytes, os.ModePerm); err != nil {
return err
}
Expand Down

0 comments on commit 0859208

Please sign in to comment.