Skip to content

Commit

Permalink
feat: detect purescript projects
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Jun 23, 2024
1 parent 81be366 commit bda4e20
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 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 @@ -438,35 +467,6 @@ 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;
}

await actions.save(project.id, [
{
id: createId(),
Expand All @@ -489,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 @@ -554,12 +561,5 @@ export async function detectProjectType(src: string): Promise<string> {
return "haskell";
}

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

return "base";
}

0 comments on commit bda4e20

Please sign in to comment.