File tree Expand file tree Collapse file tree 5 files changed +23
-18
lines changed Expand file tree Collapse file tree 5 files changed +23
-18
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ let package = Package(
31
31
name: " CommentCLI " ,
32
32
dependencies: [
33
33
. target( name: " CommentCore " ) ,
34
+ . target( name: " Extensions " ) ,
34
35
]
35
36
) ,
36
37
. target(
@@ -53,6 +54,7 @@ let package = Package(
53
54
. product( name: " Yams " , package : " Yams " ) ,
54
55
. target( name: " CommentCLI " ) ,
55
56
]
56
- )
57
+ ) ,
58
+ . target( name: " Extensions " )
57
59
]
58
60
)
Original file line number Diff line number Diff line change 8
8
import Foundation
9
9
import ArgumentParser
10
10
import CommentCore
11
+ import Extensions
11
12
12
13
/// A command-line interface for creating or updating a comment on a GitHub issue or pull request.
13
14
package struct Comment : ParsableCommand {
@@ -45,7 +46,7 @@ package struct Comment: ParsableCommand {
45
46
print ( " inputs.owner: \( owner) " )
46
47
let repo = ProcessInfo . processInfo. environment [ " REPO " ] ?? repo
47
48
print ( " inputs.repo: \( repo) " )
48
- let number = try Int ( try : ProcessInfo. processInfo. environment [ " NUMBER " ] ?? number)
49
+ let number = try Int ( string : ProcessInfo . processInfo. environment [ " NUMBER " ] ?? number)
49
50
print ( " inputs.number: \( number) " )
50
51
let anchor = ProcessInfo . processInfo. environment [ " ANCHOR " ] ?? anchor
51
52
print ( " inputs.anchor: \( anchor) " )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ //
2
+ // Int+Ext.swift
3
+ //
4
+ //
5
+ // Created by zwc on 2024/9/7.
6
+ //
7
+
8
+ import Foundation
9
+
10
+ package extension Int {
11
+ init ( string: String , line: Int = #line) throws {
12
+ guard let int = Int ( string) else {
13
+ throw NSError ( domain: " Required string of integer " , code: line)
14
+ }
15
+ self = int
16
+ }
17
+ }
Original file line number Diff line number Diff line change 7
7
8
8
import Foundation
9
9
10
- extension Task where Failure == Error {
10
+ package extension Task where Failure == Error {
11
11
/// Performs an async task in a sync context.
12
12
///
13
13
/// - Note: This function blocks the thread until the given operation is finished. The caller is responsible for managing multithreading.
You can’t perform that action at this time.
0 commit comments