Skip to content

Commit 46b4379

Browse files
committed

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

polycode/cli.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ package polycode
33
import (
44
"encoding/json"
55
"fmt"
6+
"os"
67
)
78

89
func runCliCommand(args []string) error {
910
switch args[0] {
1011
case "info":
1112
{
12-
return getAppInfo()
13+
return getAppInfo(args[1])
1314
}
1415
default:
1516
{
@@ -18,7 +19,7 @@ func runCliCommand(args []string) error {
1819
}
1920
}
2021

21-
func getAppInfo() error {
22+
func getAppInfo(filePath string) error {
2223
var services []ServiceData
2324
for name := range serviceMap {
2425
services = append(services, ServiceData{
@@ -37,6 +38,10 @@ func getAppInfo() error {
3738
return err
3839
}
3940

40-
println(string(output))
41+
err = os.WriteFile(filePath, output, 0644)
42+
if err != nil {
43+
return err
44+
}
45+
4146
return nil
4247
}

0 commit comments

Comments
 (0)