Extension template is executable according to git

This commit is contained in:
Sam Coe 2021-08-23 10:36:29 -07:00
parent c8963a6345
commit 5756e2397a
No known key found for this signature in database
GPG key ID: 8E322C20F811D086

View file

@ -306,6 +306,17 @@ func (m *Manager) Create(name string) error {
`, name, "%s", "%v")
filePath := filepath.Join(name, name)
err = ioutil.WriteFile(filePath, []byte(fileTmpl), 0755)
if err != nil {
return err
}
wd, err := os.Getwd()
if err != nil {
return err
}
dir := filepath.Join(wd, name)
addCmd := m.newCommand(exe, "-C", dir, "--git-dir="+filepath.Join(dir, ".git"), "add", name, "--chmod=+x")
err = addCmd.Run()
return err
}