Skip to content

Commit 655c102

Browse files
authored
Merge pull request #14 from rofle100lvl/SmallImprovements
Fix saving files
2 parents 553dc3f + 03e5d9f commit 655c102

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

Sources/UseGraphPeriphery/GraphBuilder.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,8 @@ final class GraphBuilder {
6262
guard let format = mapFormat(format: format) else { fatalError() }
6363
let data = try await buildGraphData(edges: edges, format: format)
6464
let url = URL(fileURLWithPath: FileManager.default.currentDirectoryPath).appending(path: "Graph.\(format.rawValue)")
65-
guard let fileContents = String(data: data, encoding: .utf8) else { fatalError() }
66-
67-
Task {
68-
System.shared.run("open \(url.path())")
69-
}
65+
FileManager.default.createFile(atPath: url.path(), contents: data)
66+
System.shared.run("open \(url.path())")
7067
case .csv:
7168
csvBuildGraph(edges: edges)
7269
}

0 commit comments

Comments
 (0)