mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-14 09:42:10 -04:00
clipboard: simplify copyFile, fix copy image from history
This commit is contained in:
@@ -66,7 +66,7 @@ func (m *Manager) Install(theme Theme, registryThemeDir string) error {
|
||||
return fmt.Errorf("theme already installed: %s", theme.Name)
|
||||
}
|
||||
|
||||
if err := m.fs.MkdirAll(themeDir, 0755); err != nil {
|
||||
if err := m.fs.MkdirAll(themeDir, 0o755); err != nil {
|
||||
return fmt.Errorf("failed to create theme directory: %w", err)
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ func (m *Manager) Install(theme Theme, registryThemeDir string) error {
|
||||
}
|
||||
|
||||
themePath := filepath.Join(themeDir, "theme.json")
|
||||
if err := afero.WriteFile(m.fs, themePath, data, 0644); err != nil {
|
||||
if err := afero.WriteFile(m.fs, themePath, data, 0o644); err != nil {
|
||||
return fmt.Errorf("failed to write theme file: %w", err)
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ func (m *Manager) copyPreviewFiles(srcDir, dstDir string, theme Theme) {
|
||||
continue
|
||||
}
|
||||
dstPath := filepath.Join(dstDir, preview)
|
||||
_ = afero.WriteFile(m.fs, dstPath, data, 0644)
|
||||
_ = afero.WriteFile(m.fs, dstPath, data, 0o644)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ func (m *Manager) Update(theme Theme) error {
|
||||
return fmt.Errorf("failed to marshal theme: %w", err)
|
||||
}
|
||||
|
||||
if err := afero.WriteFile(m.fs, themePath, data, 0644); err != nil {
|
||||
if err := afero.WriteFile(m.fs, themePath, data, 0o644); err != nil {
|
||||
return fmt.Errorf("failed to write theme file: %w", err)
|
||||
}
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ func (r *Registry) Update() error {
|
||||
}
|
||||
|
||||
if !exists {
|
||||
if err := r.fs.MkdirAll(filepath.Dir(r.cacheDir), 0755); err != nil {
|
||||
if err := r.fs.MkdirAll(filepath.Dir(r.cacheDir), 0o755); err != nil {
|
||||
return fmt.Errorf("failed to create cache directory: %w", err)
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ func (r *Registry) Update() error {
|
||||
return fmt.Errorf("failed to remove corrupted registry: %w", err)
|
||||
}
|
||||
|
||||
if err := r.fs.MkdirAll(filepath.Dir(r.cacheDir), 0755); err != nil {
|
||||
if err := r.fs.MkdirAll(filepath.Dir(r.cacheDir), 0o755); err != nil {
|
||||
return fmt.Errorf("failed to create cache directory: %w", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user