Skip to content

Commit ad81129

Browse files
committed
fix - posthog secret on build
1 parent 5f7b870 commit ad81129

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ To install AssemblyAI CLI, use any of the following methods:
2626
$ cask install github.com/AssemblyAI/assemblyai-cli
2727
```
2828

29+
- ### Go lang
30+
31+
``` bash
32+
$ go install github.com/AssemblyAI/assemblyai-cli
33+
```
34+
2935
## Commands
3036

3137
- `config`: Use the config command to store your authentication token and automatically use it in any subsequent request.

assemblyai-cli

144 Bytes
Binary file not shown.

cmd/utils.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,16 @@ import (
2121

2222
var AAITokenEnvName = "ASSMEBLYAI_TOKEN"
2323
var AAIURL = "https://api.assemblyai.com/v2"
24+
var PH_TOKEN string
2425

2526
func TelemetryCaptureEvent(event string, properties map[string]interface{}) {
2627
isTelemetryEnabled := getConfigFileValue("features.telemetry")
2728
if isTelemetryEnabled == "true" {
28-
godotenv.Load()
29-
PH_TOKEN := os.Getenv("POSTHOG_API_TOKEN")
29+
30+
if PH_TOKEN == "" {
31+
godotenv.Load()
32+
PH_TOKEN = os.Getenv("POSTHOG_API_TOKEN")
33+
}
3034

3135
client := posthog.New(PH_TOKEN)
3236
defer client.Close()

main.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ Copyright © 2022 AssemblyAI [email protected]
33
*/
44
package main
55

6-
import "github.com/AssemblyAI/assemblyai-cli/cmd"
6+
import (
7+
"github.com/AssemblyAI/assemblyai-cli/cmd"
8+
)
79

810
func main() {
911
cmd.Execute()

0 commit comments

Comments
 (0)