@@ -12,8 +12,8 @@ internal final class XcodeTemplateGenerator {
12
12
self . fileSystem = fileSystem
13
13
}
14
14
15
- internal func generate( template: XcodeTemplate , into url : URL ) throws {
16
- let url : URL = url
15
+ internal func generate( template: XcodeTemplate , into directory : URL ) throws {
16
+ let url : URL = directory
17
17
. appendingPathComponent ( template. name)
18
18
. appendingPathExtension ( " xctemplate " )
19
19
try ? fileSystem. removeItem ( at: url)
@@ -23,36 +23,36 @@ internal final class XcodeTemplateGenerator {
23
23
try copyIcons ( into: url)
24
24
}
25
25
26
- private func renderStencils( for template: XcodeTemplate , into url : URL ) throws {
26
+ private func renderStencils( for template: XcodeTemplate , into directory : URL ) throws {
27
27
let stencilRenderer : StencilRenderer = . init( )
28
28
try template. stencils. forEach { stencil in
29
29
let contents : String = try stencilRenderer. render ( stencil, with: template. stencilContext. dictionary)
30
30
try fileSystem. write ( Data ( contents. utf8) ,
31
- to: url
31
+ to: directory
32
32
. appendingPathComponent ( " ___FILEBASENAME___ \( stencil. name) " )
33
33
. appendingPathExtension ( " swift " ) ,
34
34
atomically: true )
35
35
}
36
36
}
37
37
38
- private func writePropertyList( for template: XcodeTemplate , into url : URL ) throws {
38
+ private func writePropertyList( for template: XcodeTemplate , into directory : URL ) throws {
39
39
try fileSystem. write ( template. propertyList. encode ( ) ,
40
- to: url
40
+ to: directory
41
41
. appendingPathComponent ( " TemplateInfo " )
42
42
. appendingPathExtension ( " plist " ) ,
43
43
atomically: true )
44
44
}
45
45
46
- private func copyIcons( into url : URL ) throws {
46
+ private func copyIcons( into directory : URL ) throws {
47
47
let bundle : Bundle = . moduleRelativeToExecutable ?? . module
48
48
// swiftlint:disable:next force_unwrapping
49
49
try fileSystem. copyItem ( at: bundle. url ( forResource: " Tinder " , withExtension: " png " ) !,
50
- to: url
50
+ to: directory
51
51
. appendingPathComponent ( " TemplateIcon " )
52
52
. appendingPathExtension ( " png " ) )
53
53
// swiftlint:disable:next force_unwrapping
54
54
try fileSystem. copyItem ( at: bundle. url ( forResource: " Tinder@2x " , withExtension: " png " ) !,
55
- to: url
55
+ to: directory
56
56
. appendingPathComponent ( " TemplateIcon@2x " )
57
57
. appendingPathExtension ( " png " ) )
58
58
}
0 commit comments