diff --git a/Dockerfile b/Dockerfile index 1a67934..9a3cb59 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/swiftwasm/swift:5.6-focal +FROM ghcr.io/swiftwasm/swift:5.7-focal LABEL maintainer="SwiftWasm Maintainers " LABEL Description="Carton is a watcher, bundler, and test runner for your SwiftWasm apps" @@ -16,7 +16,7 @@ RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && ap rm -r /var/lib/apt/lists/* ENV CARTON_ROOT=/root/.carton -ENV CARTON_DEFAULT_TOOLCHAIN=wasm-5.6.0-RELEASE +ENV CARTON_DEFAULT_TOOLCHAIN=wasm-5.7.1-RELEASE RUN mkdir -p $CARTON_ROOT/sdk && \ mkdir -p $CARTON_ROOT/sdk/$CARTON_DEFAULT_TOOLCHAIN && \ diff --git a/Sources/CartonHelpers/DefaultToolchain.swift b/Sources/CartonHelpers/DefaultToolchain.swift index 4223f58..415f75c 100644 --- a/Sources/CartonHelpers/DefaultToolchain.swift +++ b/Sources/CartonHelpers/DefaultToolchain.swift @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -public let defaultToolchainVersion = "wasm-5.6.0-RELEASE" +public let defaultToolchainVersion = "wasm-5.7.1-RELEASE" diff --git a/Sources/CartonKit/Model/Template.swift b/Sources/CartonKit/Model/Template.swift index 97f09d1..3aad808 100644 --- a/Sources/CartonKit/Model/Template.swift +++ b/Sources/CartonKit/Model/Template.swift @@ -179,7 +179,7 @@ extension Templates { .init( name: "Tokamak", url: "https://github.com/TokamakUI/Tokamak", - version: .from("0.10.0") + version: .from("0.11.0") ), ], targetDepencencies: [ @@ -187,18 +187,17 @@ extension Templates { ], terminal ) - - try fileSystem.removeFileTree(project.path.appending( + + let sources = project.path.appending( components: "Sources", - project.name, - "main.swift" - )) - - try fileSystem.writeFileContents(project.path.appending( - components: "Sources", - project.name, - "App.swift" - )) { + project.name + ) + + for source in try fileSystem.getDirectoryContents(sources) { + try fileSystem.removeFileTree(sources.appending(components: source)) + } + + try fileSystem.writeFileContents(sources.appending(components: "App.swift")) { """ import TokamakDOM diff --git a/Tests/CartonCommandTests/InitCommandTests.swift b/Tests/CartonCommandTests/InitCommandTests.swift index b214362..d0a2940 100644 --- a/Tests/CartonCommandTests/InitCommandTests.swift +++ b/Tests/CartonCommandTests/InitCommandTests.swift @@ -39,8 +39,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)/\(package).swift"), + "Sources/\(package)/\(package).swift does not exist" ) XCTAssertTrue(packageDirectory.ls().contains("Tests"), "Tests does not exist") XCTAssertTrue(