template / ci-testing / files / parameter_data.go
Branch ci-testing · default branch · all branches
parameter_data.go
687d5626 2022-10-28 Pavel Safronov | 1 | package main |
| 2 | ||
| 3 | import "path/filepath" | |
| 4 | ||
| 5 | type PrePatternData struct { | |
| 6 | ProjectName string | |
| 7 | Year, Month, Day, Hour, Minute, Second string | |
| 8 | Extras map[string]string | |
| 9 | } | |
| 10 | ||
| 11 | type PostPatternData struct { | |
| 12 | PrePatternData | |
| 13 | FileName string | |
| 14 | FileNameWithoutExtension string | |
| 15 | FullPath string | |
| 16 | } | |
| 17 | ||
| 18 | func createPostPatternData(fullPath string, prePatternData PrePatternData) PostPatternData { | |
| 19 | fileName := filepath.Base(fullPath) | |
| 20 | fileNameWithoutExt := fileName[:len(fileName)-len(filepath.Ext(fileName))] | |
| 21 | return PostPatternData{ | |
| 22 | FullPath: fullPath, | |
| 23 | FileName: fileName, | |
| 24 | FileNameWithoutExtension: fileNameWithoutExt, | |
| 25 | PrePatternData: prePatternData, | |
| 26 | } | |
| 27 | } |