Skip to content

Commit

Permalink
Fix permissions issue for folder "temp" and file "state.dat"
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaDoes committed Jul 12, 2018
1 parent 50a65f4 commit e3ddbf1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func isCompletedDownload(asset string) bool {
func addCompletedDownload(asset string) {
completedDownloads.Assets = append(completedDownloads.Assets, asset)
completedDownloadsJSON, _ := json.MarshalIndent(completedDownloads, "", "\t")
_ = ioutil.WriteFile("state.dat", completedDownloadsJSON, 644)
_ = ioutil.WriteFile("state.dat", completedDownloadsJSON, 0644)
}

func getDots(assetName string, longestAssetName int) string {
Expand Down Expand Up @@ -253,7 +253,7 @@ func fileDownload(url, location string) (string, string, error) {

func mkdir(dir string) error {
if _, err := os.Stat(dir); os.IsNotExist(err) {
err = os.MkdirAll(dir, 777)
err = os.MkdirAll(dir, 0777)
if err != nil {
return err
}
Expand Down

0 comments on commit e3ddbf1

Please sign in to comment.