parent
2f462a4693
commit
bdb5d5944a
|
@ -187,14 +187,22 @@ extension Templates {
|
|||
],
|
||||
terminal
|
||||
)
|
||||
try fileSystem.writeFileContents(project.path.appending(
|
||||
|
||||
try fileSystem.removeFileTree(project.path.appending(
|
||||
components: "Sources",
|
||||
project.name,
|
||||
"main.swift"
|
||||
))
|
||||
|
||||
try fileSystem.writeFileContents(project.path.appending(
|
||||
components: "Sources",
|
||||
project.name,
|
||||
"App.swift"
|
||||
)) {
|
||||
"""
|
||||
import TokamakDOM
|
||||
|
||||
@main
|
||||
struct TokamakApp: App {
|
||||
var body: some Scene {
|
||||
WindowGroup("Tokamak App") {
|
||||
|
@ -208,11 +216,6 @@ extension Templates {
|
|||
Text("Hello, world!")
|
||||
}
|
||||
}
|
||||
|
||||
// @main attribute is not supported in SwiftPM apps.
|
||||
// See https://bugs.swift.org/browse/SR-12683 for more details.
|
||||
TokamakApp.main()
|
||||
|
||||
"""
|
||||
.write(to: $0)
|
||||
}
|
||||
|
|
|
@ -74,8 +74,8 @@ final class InitCommandTests: XCTestCase {
|
|||
"Sources/\(package) does not exist"
|
||||
)
|
||||
XCTAssertTrue(
|
||||
packageDirectory.ls().contains("Sources/\(package)/main.swift"),
|
||||
"Sources/\(package)/main.swift does not exist"
|
||||
packageDirectory.ls().contains("Sources/\(package)/App.swift"),
|
||||
"Sources/\(package)/App.swift does not exist"
|
||||
)
|
||||
XCTAssertTrue(packageDirectory.ls().contains("Tests"), "Tests does not exist")
|
||||
XCTAssertTrue(
|
||||
|
@ -88,7 +88,7 @@ final class InitCommandTests: XCTestCase {
|
|||
)
|
||||
|
||||
let actualTemplateSource = try String(contentsOfFile: packageDirectory
|
||||
.appending(components: "Sources", package, "main.swift").pathString)
|
||||
.appending(components: "Sources", package, "App.swift").pathString)
|
||||
|
||||
XCTAssertEqual(expectedTemplateSource, actualTemplateSource, "Template Sources do not match")
|
||||
}
|
||||
|
@ -98,6 +98,7 @@ final class InitCommandTests: XCTestCase {
|
|||
"""
|
||||
import TokamakDOM
|
||||
|
||||
@main
|
||||
struct TokamakApp: App {
|
||||
var body: some Scene {
|
||||
WindowGroup("Tokamak App") {
|
||||
|
@ -111,10 +112,5 @@ final class InitCommandTests: XCTestCase {
|
|||
Text("Hello, world!")
|
||||
}
|
||||
}
|
||||
|
||||
// @main attribute is not supported in SwiftPM apps.
|
||||
// See https://bugs.swift.org/browse/SR-12683 for more details.
|
||||
TokamakApp.main()
|
||||
|
||||
"""
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue