Skip to content

Commit 5666f66

Browse files
committed
update
1 parent fa542bd commit 5666f66

File tree

1 file changed

+18
-17
lines changed
  • components/ide/jetbrains/image/status

1 file changed

+18
-17
lines changed

components/ide/jetbrains/image/status/main.go

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,25 @@ func main() {
9090
log.Info(ServiceName + ": " + Version)
9191
startTime := time.Now()
9292

93-
// status warmup intellij
94-
// status port alias label
95-
96-
if len(os.Args) < 3 {
97-
log.Fatalf("Usage: %s <port> <kind> [<link label>]\n", os.Args[0])
98-
}
99-
10093
var port string
10194
var warmup bool
10295

96+
if len(os.Args) < 2 {
97+
log.Fatalf("Usage: %s (warmup|<port>)\n", os.Args[0])
98+
}
99+
103100
if os.Args[1] == "warmup" {
101+
if len(os.Args) < 2 {
102+
log.Fatalf("Usage: %s <alias>\n", os.Args[0])
103+
}
104+
104105
warmup = true
105106
} else {
106-
port := os.Args[1]
107+
if len(os.Args) < 3 {
108+
log.Fatalf("Usage: %s <port> <kind> [<link label>]\n", os.Args[0])
109+
}
110+
111+
port = os.Args[1]
107112
}
108113

109114
alias := os.Args[2]
@@ -142,9 +147,10 @@ func main() {
142147
launchCtx := &LaunchContext{
143148
startTime: startTime,
144149

145-
port: port,
146-
alias: alias,
147-
label: label,
150+
warmup: warmup,
151+
port: port,
152+
alias: alias,
153+
label: label,
148154

149155
qualifier: qualifier,
150156
productDir: productDir,
@@ -154,12 +160,7 @@ func main() {
154160
wsInfo: wsInfo,
155161
}
156162

157-
// if len(os.Args) == 3 && os.Args[1] == "warmup" {
158-
159-
// }
160-
161-
if os.Args[1] == "warmup" {
162-
launchCtx.warmup = true
163+
if launchCtx.warmup {
163164
launch(launchCtx)
164165
return
165166
}

0 commit comments

Comments
 (0)