Skip to content

Commit

Permalink
Create a gotalink.txt for index.html during cmd call
Browse files Browse the repository at this point in the history
  • Loading branch information
John Bryan Sazon committed Apr 27, 2018
1 parent 37116b9 commit 75f1015
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
gotalink.txt
gota
ios_assets/
android_assets/
Expand Down
8 changes: 8 additions & 0 deletions cmd/nexus.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
package cmd

import (
"io/ioutil"
"log"
"os"
"strings"

nexuspkg "github.com/bzon/gota/nexus"
"github.com/spf13/cobra"
Expand All @@ -39,6 +41,12 @@ var nexusCmd = &cobra.Command{
}
for _, v := range assets {
log.Println("file uploaded:", v)
// write the index.html file (the ota link) to a file
if strings.Contains(v, "index.html") {
if err := ioutil.WriteFile("gotalink.txt", []byte(v), 0644); err != nil {
log.Fatal(err)
}
}
}
},
}
Expand Down

0 comments on commit 75f1015

Please sign in to comment.