create pre-commit file to skip big files

master
Bel LaPointe 2021-02-25 22:09:50 -06:00
parent 0c6d3a6c6a
commit baf739658e
1 changed files with 5 additions and 2 deletions

View File

@ -2,8 +2,11 @@ package versions
import ( import (
"fmt" "fmt"
"io/ioutil"
"local/notes-server/config" "local/notes-server/config"
"os"
"os/exec" "os/exec"
"path"
"time" "time"
) )
@ -16,8 +19,8 @@ func New() (*Versions, error) {
v.cmd("git", "config", "user.email", "user@user.user") v.cmd("git", "config", "user.email", "user@user.user")
v.cmd("git", "config", "user.name", "user") v.cmd("git", "config", "user.name", "user")
s := getScript() s := getScript()
panic(s) err := ioutil.WriteFile(path.Join(config.Root, "./.git/hooks/pre-commit"), []byte(s), os.ModePerm)
return v, nil return v, err
} }
func (v *Versions) Gitmmit() error { func (v *Versions) Gitmmit() error {