Skip to content

Commit

Permalink
Merge pull request #51 from fluentci-io/feat/detect-haskell-projects
Browse files Browse the repository at this point in the history
feat: detect haskell projects
  • Loading branch information
tsirysndr authored Jun 23, 2024
2 parents 55cf85e + bda4e20 commit 9b206a7
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions src/detect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,35 @@ export default async function detect(src: string): Promise<void> {
return;
}

if (
(await fileExists(`${src}/spago.yaml`)) ||
(await fileExists(`${src}/spago.dhall`))
) {
await actions.save(project.id, [
{
id: createId(),
name: "tests",
commands: "test",
enabled: true,
plugin: "purescript",
useWasm: true,
logo: "https://upload.wikimedia.org/wikipedia/commons/6/64/PureScript_Logo.png",
githubUrl: "https://github.com/fluentci-io/purescipt-plugin",
},
{
id: createId(),
name: "build",
commands: "build",
enabled: true,
plugin: "purescript",
useWasm: true,
logo: "https://upload.wikimedia.org/wikipedia/commons/6/64/PureScript_Logo.png",
githubUrl: "https://github.com/fluentci-io/purescript-plugin",
},
]);
return;
}

if (
(await fileExists(`${src}/package.json`)) &&
(await fileExists(`${src}/bun.lockb`))
Expand Down Expand Up @@ -409,7 +438,32 @@ export default async function detect(src: string): Promise<void> {
githubUrl: "https://github.com/fluent-ci-templates/swift-pipeline",
},
]);
return;
}

if (await fileExists(`${src}/cabal.project`)) {
await actions.save(project.id, [
{
id: createId(),
name: "tests",
commands: "test",
enabled: true,
plugin: "haskell",
useWasm: true,
logo: "https://upload.wikimedia.org/wikipedia/commons/1/1c/Haskell-Logo.svg",
githubUrl: "https://github.com/fluentci-io/haskell-plugin",
},
{
id: createId(),
name: "build",
commands: "build",
enabled: true,
plugin: "haskell",
useWasm: true,
logo: "https://upload.wikimedia.org/wikipedia/commons/1/1c/Haskell-Logo.svg",
githubUrl: "https://github.com/fluentci-io/haskell-plugin",
},
]);
return;
}

Expand All @@ -435,6 +489,13 @@ export async function detectProjectType(src: string): Promise<string> {
return "go";
}

if (
(await fileExists(`${src}/spago.yaml`)) ||
(await fileExists(`${src}/spago.dhall`))
) {
return "purescript";
}

if (
(await fileExists(`${src}/package.json`)) &&
(await fileExists(`${src}/bun.lockb`))
Expand Down Expand Up @@ -496,5 +557,9 @@ export async function detectProjectType(src: string): Promise<string> {
return "swift";
}

if (await fileExists(`${src}/cabal.project`)) {
return "haskell";
}

return "base";
}

0 comments on commit 9b206a7

Please sign in to comment.