diff --git a/src/apply/apply.go b/src/apply/apply.go index 19b87864e7..a65539306a 100644 --- a/src/apply/apply.go +++ b/src/apply/apply.go @@ -102,11 +102,11 @@ func AdditionalOptions(appsFolderPath string, flags Flag) { // To use default color scheme, set `scheme` to `nil` func UserCSS(appsFolderPath, themeFolder string, scheme map[string]string) { colorsDest := filepath.Join(appsFolderPath, "xpui", "colors.css") - if err := os.WriteFile(colorsDest, []byte(getColorCSS(scheme)), 0700); err != nil { + if err := os.WriteFile(colorsDest, []byte(getColorCSS(scheme)), 0770); err != nil { utils.Fatal(err) } cssDest := filepath.Join(appsFolderPath, "xpui", "user.css") - if err := os.WriteFile(cssDest, []byte(getUserCSS(themeFolder)), 0700); err != nil { + if err := os.WriteFile(cssDest, []byte(getUserCSS(themeFolder)), 0770); err != nil { utils.Fatal(err) } } diff --git a/src/cmd/apply.go b/src/cmd/apply.go index e2a3e0f415..bb64816d25 100644 --- a/src/cmd/apply.go +++ b/src/cmd/apply.go @@ -161,7 +161,7 @@ func refreshThemeCSS() { os.WriteFile( filepath.Join(appDestPath, "xpui", "spicetify-config.json"), configJsonBytes, - 0700) + 0770) } } @@ -300,7 +300,7 @@ func RefreshApps(list ...string) { os.WriteFile( filepath.Join(appDestPath, "xpui", appName+".json"), manifestFileContent, - 0700) + 0770) var manifestJson utils.AppManifest if err = json.Unmarshal(manifestFileContent, &manifestJson); err == nil { @@ -368,7 +368,7 @@ func RefreshApps(list ...string) { os.WriteFile( filepath.Join(appDestPath, "xpui", appName+".js"), []byte(jsTemplate), - 0700) + 0770) cssFile := filepath.Join(customAppPath, "style.css") cssFileContent, err := os.ReadFile(cssFile) @@ -378,7 +378,7 @@ func RefreshApps(list ...string) { os.WriteFile( filepath.Join(appDestPath, "xpui", appName+".css"), []byte(cssFileContent), - 0700) + 0770) } } diff --git a/src/cmd/backup.go b/src/cmd/backup.go index 37abc2a037..c06d74f5e8 100644 --- a/src/cmd/backup.go +++ b/src/cmd/backup.go @@ -114,17 +114,17 @@ func clearBackup() { if err := os.RemoveAll(backupFolder); err != nil { utils.Fatal(err) } - os.Mkdir(backupFolder, 0700) + os.Mkdir(backupFolder, 0770) if err := os.RemoveAll(rawFolder); err != nil { utils.Fatal(err) } - os.Mkdir(rawFolder, 0700) + os.Mkdir(rawFolder, 0770) if err := os.RemoveAll(themedFolder); err != nil { utils.Fatal(err) } - os.Mkdir(themedFolder, 0700) + os.Mkdir(themedFolder, 0770) backupSection.Key("version").SetValue("") backupSection.Key("with").SetValue("") diff --git a/src/utils/utils.go b/src/utils/utils.go index e4f32d18df..0fb57cff98 100644 --- a/src/utils/utils.go +++ b/src/utils/utils.go @@ -22,7 +22,7 @@ import ( func CheckExistAndCreate(dir string) { _, err := os.Stat(dir) if err != nil { - os.MkdirAll(dir, 0700) + os.MkdirAll(dir, 0770) } } @@ -52,20 +52,20 @@ func Unzip(src, dest string) error { fpath := filepath.Join(dest, f.Name) if f.FileInfo().IsDir() { - os.MkdirAll(fpath, 0700) + os.MkdirAll(fpath, 0770) } else { var fdir string if lastIndex := strings.LastIndex(fpath, string(os.PathSeparator)); lastIndex > -1 { fdir = fpath[:lastIndex] } - err = os.MkdirAll(fdir, 0700) + err = os.MkdirAll(fdir, 0770) if err != nil { log.Fatal(err) return err } f, err := os.OpenFile( - fpath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0700) + fpath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0770) if err != nil { return err } @@ -87,7 +87,7 @@ func Copy(src, dest string, recursive bool, filters []string) error { return err } - os.MkdirAll(dest, 0700) + os.MkdirAll(dest, 0770) for _, file := range dir { fileName := file.Name() @@ -95,7 +95,7 @@ func Copy(src, dest string, recursive bool, filters []string) error { fDestPath := filepath.Join(dest, fileName) if file.IsDir() && recursive { - os.MkdirAll(fDestPath, 0700) + os.MkdirAll(fDestPath, 0770) if err = Copy(fSrcPath, fDestPath, true, filters); err != nil { return err } @@ -122,7 +122,7 @@ func Copy(src, dest string, recursive bool, filters []string) error { defer fSrc.Close() fDest, err := os.OpenFile( - fDestPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0700) + fDestPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0770) if err != nil { return err } @@ -148,7 +148,7 @@ func CopyFile(srcPath, dest string) error { CheckExistAndCreate(dest) destPath := filepath.Join(dest, filepath.Base(srcPath)) fDest, err := os.OpenFile( - destPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0700) + destPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0770) if err != nil { return err } @@ -220,7 +220,7 @@ func ModifyFile(path string, repl func(string) string) { content := repl(string(raw)) - os.WriteFile(path, []byte(content), 0700) + os.WriteFile(path, []byte(content), 0770) } // CreateFile creates a file with given path and content.