Skip to content

Commit

Permalink
Filename based on platform and version arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
kfcampbell committed Jun 12, 2024
1 parent a017fec commit 78b0097
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion schemas/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,17 @@ func realMain() error {
return fmt.Errorf("invalid platform provided. platform must be one of dotcom, ghes, ghec. given platform: %s", platform)
}*/

out, err := os.Create("schemas/downloaded.json")
fileName := ""

if platform == "ghes" {
fileName = "schemas/" + platform + "-" + version + ".json"
} else if platform == "ghec" {
fileName = "schemas/" + platform + ".json"
} else {
fileName = "schemas/api.github.com.json"
}

out, err := os.Create(fileName)
if err != nil {
return err
}
Expand Down

0 comments on commit 78b0097

Please sign in to comment.