-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
init.go
33 lines (28 loc) · 881 Bytes
/
init.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Package craw provides support for loading Camera Raw settings.
package craw
import (
"path/filepath"
"runtime"
"strings"
"sync"
)
// Paths used to find Camera Raw settings.
var (
GlobalSettings string // The global Camera Raw settings directory.
UserSettings string // The user's Camera Raw settings directory.
EmbedProfiles string // The file where to look for embed profiles.
)
const (
globalPrefixWin = "C:/ProgramData/Adobe/CameraRaw/"
globalPrefixMac = "/Library/Application Support/Adobe/CameraRaw/"
)
var once sync.Once
func fixPath(path string) string {
if strings.HasPrefix(path, globalPrefixWin) {
path = filepath.Join(GlobalSettings, path[len(globalPrefixWin):])
}
if runtime.GOOS != "darwin" && strings.HasPrefix(path, globalPrefixMac) {
path = filepath.Join(GlobalSettings, path[len(globalPrefixMac):])
}
return filepath.FromSlash(path)
}