You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/SSH/Machine/Container.swift
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ import Foundation
6
6
7
7
publicextensionSSH{
8
8
func getDockerStat()async->[DockerStat]?{
9
-
guardlet data =awaitexec(["docker","ps","-a","--no-trunc","--format","\"{{.ID}}|{{.Image}}|{{.Names}}|{{.Status}}\""])else{
9
+
guardlet data =awaitexec([container.command,"ps","-a","--no-trunc","--format","\"{{.ID}}|{{.Image}}|{{.Names}}|{{.Status}}\""])else{
10
10
returnnil
11
11
}
12
12
guardlet text = data.string?.trim,!text.isEmpty else{
@@ -26,19 +26,19 @@ public extension SSH {
26
26
}
27
27
28
28
func dockerStart(_ id:String)async{
29
-
awaitexec(["docker","start", id])
29
+
awaitexec([container.command,"start", id])
30
30
}
31
31
32
32
func dockerStop(_ id:String)async{
33
-
awaitexec(["docker","stop", id])
33
+
awaitexec([container.command,"stop", id])
34
34
}
35
35
36
36
func dockerRestart(_ id:String)async{
37
-
awaitexec(["docker","restart", id])
37
+
awaitexec([container.command,"restart", id])
38
38
}
39
39
40
40
func dockerInspect(_ id:String)async->String?{
41
-
guardlet data =awaitexec(["docker","inspect", id])else{
41
+
guardlet data =awaitexec([container.command,"inspect", id])else{
42
42
returnnil
43
43
}
44
44
guardlet text = data.string?.trim,!text.isEmpty else{
@@ -48,7 +48,7 @@ public extension SSH {
48
48
}
49
49
50
50
func dockerLogs(_ id:String)async->String?{
51
-
guardlet data =awaitexec(["docker","logs","--tail","1000", id])else{
51
+
guardlet data =awaitexec([container.command,"logs","--tail","1000", id])else{
52
52
returnnil
53
53
}
54
54
guardlet text = data.string?.trim,!text.isEmpty else{
@@ -58,7 +58,7 @@ public extension SSH {
58
58
}
59
59
60
60
func getDockerStats()async->[DockerStats]?{
61
-
guardlet data =awaitexec(["docker","stats","--no-trunc","--no-stream","--format","\"{{.ID}}|{{.Name}}|{{.CPUPerc}}|{{.MemPerc}}|{{.NetIO}}|{{.BlockIO}}\""])else{
61
+
guardlet data =awaitexec([container.command,"stats","--no-trunc","--no-stream","--format","\"{{.ID}}|{{.Name}}|{{.CPUPerc}}|{{.MemPerc}}|{{.NetIO}}|{{.BlockIO}}\""])else{
62
62
returnnil
63
63
}
64
64
guardlet text = data.string?.trim,!text.isEmpty else{
0 commit comments