Skip to content

Commit 00bf1d5

Browse files
committed
Implementing Snap
1 parent bf0737c commit 00bf1d5

File tree

22 files changed

+743
-73
lines changed

22 files changed

+743
-73
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@ on: [push]
55
jobs:
66
build:
77
strategy:
8+
fail-fast: false
89
matrix:
9-
os: [macos-latest]
10+
os: [macos-latest, ubuntu-latest]
1011

1112
runs-on: ${{ matrix.os }}
1213

1314
steps:
14-
- name: Get swift version
15-
run: swift --version
1615
- uses: actions/checkout@v2
1716
- name: Build
18-
run: swift build -v --enable-test-discovery
17+
run: |
18+
swift --version
19+
swift build -v --enable-test-discovery
1920
- name: Test
20-
run: swift test -v --enable-test-discovery
21+
run: swift test -v --enable-test-discovery --parallel

Package.resolved

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,24 @@ let package = Package(
1212
],
1313
products: [
1414
.executable(name: "asc", targets: ["ASC"]),
15-
.executable(name: "push", targets: ["Push"])
15+
.executable(name: "push", targets: ["Push"]),
16+
.executable(name: "snap", targets: ["Snap"])
1617
],
1718
dependencies: [
1819
.package(url: "https://github.com/apple/swift-argument-parser", from: "0.3.1"),
19-
.package(url: "https://github.com/vapor/jwt-kit.git", from: "4.1.0")
20+
.package(url: "https://github.com/vapor/jwt-kit.git", from: "4.1.0"),
21+
.package(url: "https://github.com/kareman/SwiftShell", from: "5.0.1")
2022
],
2123
targets: [
22-
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
23-
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
2424
.target(
2525
name: "Core",
2626
dependencies: [
2727
.product(name: "JWTKit", package: "jwt-kit"),
28+
"SwiftShell"
2829
]
2930
),
31+
32+
3033
.target(
3134
name: "ASC",
3235
dependencies: [
@@ -38,6 +41,8 @@ let package = Package(
3841
name: "ASCTests",
3942
dependencies: ["ASC"]
4043
),
44+
45+
4146
.target(
4247
name: "Push",
4348
dependencies: [
@@ -49,5 +54,18 @@ let package = Package(
4954
name: "PushTests",
5055
dependencies: ["Push"]
5156
),
57+
58+
59+
.target(
60+
name: "Snap",
61+
dependencies: [
62+
"Core",
63+
.product(name: "ArgumentParser", package: "swift-argument-parser")
64+
]
65+
),
66+
.testTarget(
67+
name: "SnapTests",
68+
dependencies: ["Snap"]
69+
),
5270
]
53-
)
71+
)

Sources/ASC/cmd/ASC.swift renamed to Sources/ASC/commands/ASC.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ import Core
1212
/// The main class for the App Store Connect command line tool.
1313
public final class ASC: ParsableCommand {
1414

15-
// Customize your command's help and subcommands by implementing the
16-
// `configuration` property.
1715
public static var configuration = CommandConfiguration(
1816
// Optional abstracts and discussions are used for help output.
1917
abstract: "A utility for accessing the App Store Connect API.",
@@ -36,7 +34,7 @@ public final class ASC: ParsableCommand {
3634
/// Here you can specify parameters valid for all sub commands.
3735
struct Options: ParsableArguments {
3836

39-
@Flag(name: .shortAndLong, help: "Activate verbose logging. Prints e.g. the API response.")
37+
@Flag(name: .shortAndLong, help: "Activate verbose logging.")
4038
var verbose: Int
4139

4240
@Option(name: .shortAndLong, help: "Filter which is set as part of the request. See https://developer.apple.com/documentation/appstoreconnectapi for possible values.")

Sources/Core/CommandExecution.swift

Lines changed: 0 additions & 57 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// FileManager+Extensions.swift
3+
//
4+
//
5+
// Created by Stefan Herold on 24.09.20.
6+
//
7+
8+
import Foundation
9+
10+
public extension FileManager {
11+
12+
static func createTemporaryDirectory() throws -> URL {
13+
let uuid = "com.stherold.\(ProcessInfo().processName).\(NSUUID().uuidString)"
14+
let tmpDirectoryURL = FileManager.default.temporaryDirectory.appendingPathComponent(uuid)
15+
try FileManager.default.createDirectory(at: tmpDirectoryURL, withIntermediateDirectories: true, attributes: nil)
16+
return tmpDirectoryURL
17+
}
18+
}

0 commit comments

Comments
 (0)