feat(app): add internal components batch 4
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func ffmpegMediaCommand(ctx context.Context, executable string, args ...string) *exec.Cmd {
|
||||
command := exec.CommandContext(ctx, executable, args...)
|
||||
command.Env = make([]string, 0, len(os.Environ()))
|
||||
for _, entry := range os.Environ() {
|
||||
key, _, _ := strings.Cut(entry, "=")
|
||||
switch strings.ToLower(key) {
|
||||
case "http_proxy", "https_proxy", "all_proxy":
|
||||
continue
|
||||
}
|
||||
command.Env = append(command.Env, entry)
|
||||
}
|
||||
return command
|
||||
}
|
||||
Reference in New Issue
Block a user