Skip to content

Commit 28b2099

Browse files
committed
dev
1 parent a2c3f84 commit 28b2099

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Sources/SSH/Machine/Docker.swift renamed to Sources/SSH/Machine/Container.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Foundation
66

77
public extension SSH {
88
func getDockerStat() async -> [DockerStat]? {
9-
guard let data = await exec(["docker", "ps", "-a", "--no-trunc", "--format", "\"{{.ID}}|{{.Image}}|{{.Names}}|{{.Status}}\""]) else {
9+
guard let data = await exec([container.command, "ps", "-a", "--no-trunc", "--format", "\"{{.ID}}|{{.Image}}|{{.Names}}|{{.Status}}\""]) else {
1010
return nil
1111
}
1212
guard let text = data.string?.trim,!text.isEmpty else {
@@ -26,19 +26,19 @@ public extension SSH {
2626
}
2727

2828
func dockerStart(_ id: String) async {
29-
await exec(["docker", "start", id])
29+
await exec([container.command, "start", id])
3030
}
3131

3232
func dockerStop(_ id: String) async {
33-
await exec(["docker", "stop", id])
33+
await exec([container.command, "stop", id])
3434
}
3535

3636
func dockerRestart(_ id: String) async {
37-
await exec(["docker", "restart", id])
37+
await exec([container.command, "restart", id])
3838
}
3939

4040
func dockerInspect(_ id: String) async -> String? {
41-
guard let data = await exec(["docker", "inspect", id]) else {
41+
guard let data = await exec([container.command, "inspect", id]) else {
4242
return nil
4343
}
4444
guard let text = data.string?.trim,!text.isEmpty else {
@@ -48,7 +48,7 @@ public extension SSH {
4848
}
4949

5050
func dockerLogs(_ id: String) async -> String? {
51-
guard let data = await exec(["docker", "logs", "--tail", "1000", id]) else {
51+
guard let data = await exec([container.command, "logs", "--tail", "1000", id]) else {
5252
return nil
5353
}
5454
guard let text = data.string?.trim,!text.isEmpty else {
@@ -58,7 +58,7 @@ public extension SSH {
5858
}
5959

6060
func getDockerStats() async -> [DockerStats]? {
61-
guard let data = await exec(["docker", "stats", "--no-trunc", "--no-stream", "--format", "\"{{.ID}}|{{.Name}}|{{.CPUPerc}}|{{.MemPerc}}|{{.NetIO}}|{{.BlockIO}}\""]) else {
61+
guard let data = await exec([container.command, "stats", "--no-trunc", "--no-stream", "--format", "\"{{.ID}}|{{.Name}}|{{.CPUPerc}}|{{.MemPerc}}|{{.NetIO}}|{{.BlockIO}}\""]) else {
6262
return nil
6363
}
6464
guard let text = data.string?.trim,!text.isEmpty else {

Sources/Socket/Dial.swift

Whitespace-only changes.

0 commit comments

Comments
 (0)