sync: Allow using challenge.toml instead of challenge.txt
This commit is contained in:
parent
20c41ec573
commit
2140939364
4 changed files with 12 additions and 6 deletions
|
|
@ -112,7 +112,13 @@ func (p ExerciceParams) GetRawFlags() (ret []string) {
|
|||
// parseExerciceParams reads challenge definitions from defines.txt and extract usefull data to set up the challenge.
|
||||
func parseExerciceParams(i Importer, exPath string) (p ExerciceParams, md toml.MetaData, err error) {
|
||||
var defs string
|
||||
defs, err = GetFileContent(i, path.Join(exPath, "challenge.txt"))
|
||||
|
||||
if i.Exists(path.Join(exPath, "challenge.toml")) {
|
||||
defs, err = GetFileContent(i, path.Join(exPath, "challenge.toml"))
|
||||
} else {
|
||||
defs, err = GetFileContent(i, path.Join(exPath, "challenge.txt"))
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue