File tree 1 file changed +12
-5
lines changed
1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -25,16 +25,23 @@ if !fontsFolder.containsFile(named: "SourceCodePro-Regular.ttf") {
25
25
26
26
print ( " π¨ Installing Xcode theme... " )
27
27
28
- let themeURL = URL ( fileURLWithPath: #file. replacingOccurrences ( of: " Sources/XcodeTheme/main.swift " , with: " SundellsColors.xccolortheme " ) )
29
- let themeData = try Data ( contentsOf: themeURL)
28
+ // Navigate to the Themes folder
29
+ let themesFolder = try Folder . current. subfolder ( named: " Themes " )
30
+
31
+ // Get all .xccolortheme files in the Themes folder
32
+ let themeFiles = themesFolder. files. filter { $0. extension == " xccolortheme " }
30
33
31
34
let xcodeFolder = try Folder . home. subfolder ( at: " Library/Developer/Xcode " )
32
35
let userDataFolder = try xcodeFolder. createSubfolderIfNeeded ( withName: " UserData " )
33
36
let themeFolder = try userDataFolder. createSubfolderIfNeeded ( withName: " FontAndColorThemes " )
34
37
35
- let themeFile = try themeFolder. createFile ( named: " SundellsColors.xccolortheme " )
36
- try themeFile. write ( themeData)
38
+ for themeFile in themeFiles {
39
+ let themeData = try themeFile. read ( )
40
+ let themeDestination = try themeFolder. createFile ( named: themeFile. name)
41
+ try themeDestination. write ( themeData)
42
+ print ( " π \( themeFile. name) successfully installed " )
43
+ }
37
44
38
45
print ( " " )
39
- print ( " π Sundell 's Colors successfully installed " )
46
+ print ( " π Xcode 's Themes successfully installed " )
40
47
print ( " π Select it in Xcode's preferences to start using it (you may have to restart Xcode first) " )
You canβt perform that action at this time.
0 commit comments