This repository was archived by the owner on Aug 12, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +25
-3
lines changed
internal/cmd/ach/contest/create Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -7,16 +7,19 @@ FLAGS := -ldflags "$(LD_FLAGS)"
7
7
8
8
.PHONY : install clean build ach test lint yamllint generate-docs dry-release
9
9
10
- default : build test lint yamllint generate-docs
10
+ default : fmt build test lint yamllint generate-docs
11
11
12
- all : build test yamllint lint generate-docs dry-release
12
+ all : fmt build test yamllint lint generate-docs dry-release
13
13
14
14
install :
15
15
go install ./cmd/ach
16
16
17
17
18
18
build : ach gendocs
19
19
20
+ fmt :
21
+ gofumpt -w .
22
+
20
23
21
24
ach :
22
25
go build ${FLAGS} -o ./bin/ach ./cmd/ach/main.go
Original file line number Diff line number Diff line change 1
1
package create
2
2
3
3
import (
4
+ "fmt"
4
5
"log"
5
6
"os/exec"
6
7
"os/user"
@@ -34,11 +35,29 @@ D is for directory.
34
35
35
36
for _ , taskName := range taskNames {
36
37
taskDirName := path .Join (contestName , taskName )
37
-
38
38
err := exec .Command ("cp" , "-r" , templateDirName , taskDirName ).Run ()
39
39
if err != nil {
40
40
return err
41
41
}
42
+
43
+ sampleDirName := path .Join (taskDirName , "sampleCases" )
44
+ err = exec .Command ("mkdir" , sampleDirName ).Run ()
45
+ if err != nil {
46
+ return err
47
+ }
48
+
49
+ for i := 1 ; i <= 5 ; i ++ {
50
+ inputFileName := path .Join (sampleDirName , fmt .Sprintf ("case%d.input" , i ))
51
+ err = exec .Command ("touch" , inputFileName ).Run ()
52
+ if err != nil {
53
+ return err
54
+ }
55
+ outputFileName := path .Join (sampleDirName , fmt .Sprintf ("case%d.output" , i ))
56
+ err = exec .Command ("touch" , outputFileName ).Run ()
57
+ if err != nil {
58
+ return err
59
+ }
60
+ }
42
61
}
43
62
44
63
return nil
You can’t perform that action at this time.
0 commit comments