1
1
mirror of https://github.com/theoludwig/programming-challenges.git synced 2025-05-18 12:02:53 +02:00

build(deps): update latest

This commit is contained in:
2024-11-18 01:04:51 +01:00
parent c807aeaf3f
commit 9a187deaef
21 changed files with 2152 additions and 3513 deletions

View File

@ -47,7 +47,7 @@ export class Solution implements SolutionOptions {
challenge.path,
"solutions",
programmingLanguageName,
name,
name
)
this.temporaryFolder = new TemporaryFolder()
}
@ -83,7 +83,7 @@ export class Solution implements SolutionOptions {
loader.succeed(chalk.bold.green("Success!"))
SolutionTestsResult.printBenchmark(elapsedTimeMilliseconds)
if (output) {
console.log(`${chalk.bold("Output:")}`)
console.log(chalk.bold("Output:"))
console.log(stdout)
}
} catch (error: any) {
@ -137,7 +137,7 @@ export class Solution implements SolutionOptions {
const languagesSolution = (await fs.promises.readdir(solutionsPath)).filter(
(name) => {
return name !== ".gitkeep"
},
}
)
const paths: string[] = []
for (const language of languagesSolution) {
@ -152,12 +152,12 @@ export class Solution implements SolutionOptions {
}
static async getManyByProgrammingLanguages(
programmingLanguages?: string[],
programmingLanguages?: string[]
): Promise<Solution[]> {
const languages =
programmingLanguages ?? (await template.getProgrammingLanguages())
const challengesPath = fileURLToPath(
new URL("../../challenges", import.meta.url),
new URL("../../challenges", import.meta.url)
)
const challenges = await fs.promises.readdir(challengesPath)
const paths: string[] = []

View File

@ -2,13 +2,11 @@ import path from "node:path"
import { fileURLToPath } from "node:url"
import fs from "node:fs"
import replaceInFileDefault from "replace-in-file"
import { replaceInFile } from "replace-in-file"
import date from "date-and-time"
import { copyDirectory } from "../utils/copyDirectory.js"
const { replaceInFile } = replaceInFileDefault
const TEMPLATE_PATH = fileURLToPath(new URL("../../templates", import.meta.url))
const TEMPLATE_DOCKER_PATH = path.join(TEMPLATE_PATH, "docker")
const TEMPLATE_CHALLENGE_PATH = path.join(TEMPLATE_PATH, "challenge")
@ -52,7 +50,7 @@ class Template {
}
private async replaceInDestination(
options: ReplaceInDestinationOptions,
options: ReplaceInDestinationOptions
): Promise<void> {
const { name, description, destination } = options
const readmePath = path.join(destination, "README.md")
@ -84,7 +82,7 @@ class Template {
} = options
const templateLanguagePath = path.join(
TEMPLATE_SOLUTION_PATH,
programmingLanguageName,
programmingLanguageName
)
await this.verifySupportedProgrammingLanguage(programmingLanguageName)
await fs.promises.mkdir(destination, { recursive: true })
@ -115,7 +113,7 @@ class Template {
}
public async verifySupportedProgrammingLanguage(
language: string,
language: string
): Promise<void> {
const languages = await this.getProgrammingLanguages()
if (!languages.includes(language)) {