Skip to content

Commit

Permalink
Refactor, just write dongles config, skip reading
Browse files Browse the repository at this point in the history
  • Loading branch information
gernest committed Feb 23, 2017
1 parent 1bddcca commit 1365ff4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ _testmain.go
*.exe
*.test
*.prof

bin
12 changes: 6 additions & 6 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

const (
dongleFile = "modem.conf"
dongleFile = "dongle_fessbox.conf"
diaplanTpl = "extensions_additional.conf.fastc"
diaplanOut = "extensions_additional.conf"
)
Expand Down Expand Up @@ -74,12 +74,12 @@ func Dongles(ctx *cli.Context) error {
return err
}
a := ToAST(c)
o, err := PatchAst(a)
if err != nil {
return err
}
// o, err := PatchAst(a)
// if err != nil {
// return err
// }
var buf bytes.Buffer
PrintAst(&buf, o)
PrintAst(&buf, a)
err = ioutil.WriteFile(filepath.Join(asteriskDir(), dongleFile),
buf.Bytes(), 0644,
)
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func main() {
app.Commands = []cli.Command{
{
Name: "dongles",
Aliases: []string{"e"},
Aliases: []string{"d"},
Usage: "configures asterisk dongles with json",
Action: Dongles,
},
Expand Down

0 comments on commit 1365ff4

Please sign in to comment.