Remove some config

This commit is contained in:
Owen 2025-02-18 21:41:23 -05:00
parent e6c42e9610
commit fd11fb81d6
No known key found for this signature in database
GPG key ID: 8271FDFFD9E0CCBD
6 changed files with 121 additions and 22 deletions

View file

@ -5,6 +5,7 @@ import (
"fmt"
"os"
"os/exec"
"strings"
"gopkg.in/yaml.v3"
)
@ -313,3 +314,22 @@ func MarshalYAMLWithIndent(data interface{}, indent int) ([]byte, error) {
defer encoder.Close()
return buffer.Bytes(), nil
}
func replaceInFile(filepath, oldStr, newStr string) error {
// Read the file content
content, err := os.ReadFile(filepath)
if err != nil {
return fmt.Errorf("error reading file: %v", err)
}
// Replace the string
newContent := strings.Replace(string(content), oldStr, newStr, -1)
// Write the modified content back to the file
err = os.WriteFile(filepath, []byte(newContent), 0644)
if err != nil {
return fmt.Errorf("error writing file: %v", err)
}
return nil
}