mirror of
https://github.com/theoludwig/programming-challenges.git
synced 2025-12-11 00:21:24 +01:00
feat(cli): add --all option to run test command
This commit is contained in:
@@ -73,9 +73,7 @@ class Template {
|
||||
public async solution (options: TemplateSolutionOptions): Promise<void> {
|
||||
const { destination, githubUser, name, challengeName, programmingLanguageName } = options
|
||||
const templateLanguagePath = path.join(TEMPLATE_SOLUTION_PATH, programmingLanguageName)
|
||||
if (!(await isExistingPath(templateLanguagePath))) {
|
||||
throw new Error('This programming language is not supported yet.')
|
||||
}
|
||||
await this.verifySupportedProgrammingLanguage(programmingLanguageName)
|
||||
await fs.promises.mkdir(destination, { recursive: true })
|
||||
await copyDirectory(templateLanguagePath, destination)
|
||||
await copyDirectory(TEMPLATE_SOLUTION_BASE_PATH, destination)
|
||||
@@ -95,6 +93,13 @@ class Template {
|
||||
destination
|
||||
})
|
||||
}
|
||||
|
||||
public async verifySupportedProgrammingLanguage (language: string): Promise<void> {
|
||||
const templateLanguagePath = path.join(TEMPLATE_SOLUTION_PATH, language)
|
||||
if (!(await isExistingPath(templateLanguagePath))) {
|
||||
throw new Error('This programming language is not supported yet.')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const template = new Template()
|
||||
|
||||
Reference in New Issue
Block a user