Skip to content
This repository was archived by the owner on Nov 7, 2020. It is now read-only.

Commit 054166c

Browse files
committed
fix gen bug
1 parent ada6afb commit 054166c

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

.goreleaser.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
archives:
22
-
3-
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
3+
name_template: "cf_{{ .Os }}_{{ .Arch }}"
44

55
files:
66
- none*

cmd/gen.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ func (opt Opts) RunGen() {
3333
pkg.PrintError(err, "")
3434
}
3535
// create template in current folder
36-
// leaving path to "" creates file in curr directory
37-
opt.GenCode(&cfg.Templates[idx], "")
36+
currDir, _ := os.Getwd()
37+
opt.GenCode(&cfg.Templates[idx], currDir)
3838
return
3939
}
4040

@@ -54,7 +54,8 @@ func (opt Opts) GenCode(t *cfg.Template, path string) {
5454
source := e.ReplPlaceholder(string(file))
5555

5656
// name of file to be created
57-
fName := fmt.Sprintf("${problem}${idx}%v", t.Ext)
57+
currBase := filepath.Base(path)
58+
fName := fmt.Sprintf("%v${idx}%v", currBase, t.Ext)
5859
for idx := 0; ; idx++ {
5960
// idx value to replace in string
6061
e.Idx = strconv.Itoa(idx)

cmd/misc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
)
1919

2020
// Version of the current executable
21-
const Version = "1.1.0"
21+
const Version = "1.1.1"
2222

2323
type (
2424
// Opts is struct docopt binds flag data to

0 commit comments

Comments
 (0)