Skip to content

Commit

Permalink
Merge pull request #9 from griffin-stewie/update_dependencies
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
griffin-stewie authored Mar 21, 2022
2 parents f1b94f3 + 69eb1cc commit 12c68b4
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 42 deletions.
25 changes: 17 additions & 8 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@
"repositoryURL": "https://github.com/sushichop/Puppy",
"state": {
"branch": null,
"revision": "95ce04b0e778b8d7c351876bc98bbf68328dfc9b",
"version": "0.3.1"
"revision": "7cfae42becac2d8916cb1a866dd12d9843199df9",
"version": "0.5.0"
}
},
{
"package": "swift-argument-parser",
"repositoryURL": "https://github.com/apple/swift-argument-parser",
"state": {
"branch": null,
"revision": "d2930e8fcf9c33162b9fcc1d522bc975e2d4179b",
"version": "1.0.1"
"revision": "82905286cc3f0fa8adc4674bf49437cab65a8373",
"version": "1.1.1"
}
},
{
"package": "swift-collections",
"repositoryURL": "https://github.com/apple/swift-collections.git",
"state": {
"branch": null,
"revision": "2d33a0ea89c961dcb2b3da2157963d9c0370347e",
"version": "1.0.1"
"revision": "48254824bb4248676bf7ce56014ff57b142b77eb",
"version": "1.0.2"
}
},
{
Expand All @@ -46,13 +46,22 @@
"version": "1.4.2"
}
},
{
"package": "swift-system",
"repositoryURL": "https://github.com/apple/swift-system.git",
"state": {
"branch": null,
"revision": "836bc4557b74fe6d2660218d56e3ce96aff76574",
"version": "1.1.1"
}
},
{
"package": "swift-tools-support-core",
"repositoryURL": "https://github.com/apple/swift-tools-support-core.git",
"state": {
"branch": null,
"revision": "f9bbd6b80d67408021576adf6247e17c2e957d92",
"version": "0.2.4"
"revision": "b7667f3e266af621e5cc9c77e74cacd8e8c00cb4",
"version": "0.2.5"
}
}
]
Expand Down
8 changes: 4 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ let package = Package(
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/apple/swift-argument-parser", .upToNextMinor(from: "1.0.1")),
.package(url: "https://github.com/apple/swift-tools-support-core.git", .upToNextMinor(from: "0.2.4")),
.package(url: "https://github.com/apple/swift-collections.git", .upToNextMinor(from: "1.0.0")),
.package(url: "https://github.com/apple/swift-argument-parser", .upToNextMinor(from: "1.1.1")),
.package(url: "https://github.com/apple/swift-tools-support-core.git", .upToNextMinor(from: "0.2.5")),
.package(url: "https://github.com/apple/swift-collections.git", .upToNextMinor(from: "1.0.2")),
.package(url: "https://github.com/mxcl/Path.swift.git", .upToNextMinor(from: "1.4.0")),
.package(url: "https://github.com/sushichop/Puppy", .upToNextMinor(from: "0.3.1")),
.package(url: "https://github.com/sushichop/Puppy", .upToNextMinor(from: "0.5.0")),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand Down
3 changes: 2 additions & 1 deletion Sources/xopen/Commands/RootCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import Foundation
import XopenCore
import Log

struct RootCommand: ParsableCommand {
@main
struct RootCommand: AsyncParsableCommand {
static var configuration = CommandConfiguration(
commandName: "xopen",
abstract: "Open file using Xcode version you defined by .xcode-version",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Path
import XopenCore
import Stream

struct DefaultOpenCommand: ParsableCommand {
struct DefaultOpenCommand: AsyncParsableCommand {
static var configuration = CommandConfiguration(
commandName: "defaultOpen",
abstract: "Open file using Xcode version you defined by .xcode-version",
Expand All @@ -17,14 +17,13 @@ struct DefaultOpenCommand: ParsableCommand {
@Option(name: .customLong("use-fallback"), help: ArgumentHelp("Specific Xcode version you want to use when failed to find a specific Xcode.", valueName: UserSpecificXcodeVersion.valueNames))
var fallbackVersion: UserSpecificXcodeVersion = .latest

func run() throws {
try open()
throw ExitCode.success
func run() async throws {
try await open()
}
}

extension DefaultOpenCommand {
private func open() throws {
private func open() async throws {
let rootDirectoryToFind = Path.cwd / "."

let url = try findURLToOpen(under: rootDirectoryToFind.url)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Foundation
import XopenCore
import Stream

struct HistoryCommand: ParsableCommand {
struct HistoryCommand: AsyncParsableCommand {
static var configuration = CommandConfiguration(
commandName: "history",
abstract: "Prints history opened"
Expand All @@ -12,14 +12,13 @@ struct HistoryCommand: ParsableCommand {
@OptionGroup()
var options: HistoryCommandOptions

func run() throws {
try run(options: options)
throw ExitCode.success
func run() async throws {
try await run(options: options)
}
}

extension HistoryCommand {
private func run(options: HistoryCommandOptions) throws {
private func run(options: HistoryCommandOptions) async throws {
do {
let repo = try HistoryRepository()
for url in repo.recentDocumentURLs {
Expand Down
9 changes: 4 additions & 5 deletions Sources/xopen/Commands/SubCommands/Open/OpenCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import XopenCore
import Stream
import Log

struct OpenCommand: ParsableCommand {
struct OpenCommand: AsyncParsableCommand {
static var configuration = CommandConfiguration(
commandName: "open",
abstract: "Open file using Xcode version you defined by .xcode-version"
Expand All @@ -13,14 +13,13 @@ struct OpenCommand: ParsableCommand {
@OptionGroup()
var options: OpenCommandOptions

func run() throws {
try run(options: options)
throw ExitCode.success
func run() async throws {
try await run(options: options)
}
}

extension OpenCommand {
private func run(options: OpenCommandOptions) throws {
private func run(options: OpenCommandOptions) async throws {
let url: URL
if options.autoDiscovery {
url = try findURLToOpen(under: options.rootDirectoryToFind.url)
Expand Down
9 changes: 4 additions & 5 deletions Sources/xopen/Commands/SubCommands/Write/WriteCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Stream
import Log
import Path

struct WriteCommand: ParsableCommand {
struct WriteCommand: AsyncParsableCommand {
static var configuration = CommandConfiguration(
commandName: "write",
abstract: "Write `.xcode-version` file"
Expand All @@ -14,14 +14,13 @@ struct WriteCommand: ParsableCommand {
@OptionGroup()
var options: WriteCommandOptions

func run() throws {
try run(options: options)
throw ExitCode.success
func run() async throws {
try await run(options: options)
}
}

extension WriteCommand {
private func run(options: WriteCommandOptions) throws {
private func run(options: WriteCommandOptions) async throws {
/// 2. Find installed Xcode
let xcodes = Xopen.installedXcodes()
let xcode = try xcodes.find(targetVersion: options.specificVersion)
Expand Down
9 changes: 0 additions & 9 deletions Sources/xopen/main.swift

This file was deleted.

0 comments on commit 12c68b4

Please sign in to comment.