summaryrefslogtreecommitdiff
path: root/cmd/install/utils.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/install/utils.go')
-rw-r--r--cmd/install/utils.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/install/utils.go b/cmd/install/utils.go
index 2c8b44c..8bcf4e1 100644
--- a/cmd/install/utils.go
+++ b/cmd/install/utils.go
@@ -36,6 +36,16 @@ func lineInFile(name string, lookFor string) bool {
}
}
+func createFile(name string, content string) error {
+ f, err := os.Create(name)
+ if err != nil {
+ return err
+ }
+ defer f.Close()
+ _, err = f.WriteString(fmt.Sprintf("%s\n", content))
+ return err
+}
+
func appendToFile(name string, content string) error {
f, err := os.OpenFile(name, os.O_RDWR|os.O_APPEND, 0)
if err != nil {