Skip to content

Commit

Permalink
Add nodejs.npmInstall() function
Browse files Browse the repository at this point in the history
  • Loading branch information
kylewlacy committed May 31, 2024
1 parent df3fe44 commit ff9bc62
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions projects/nodejs/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const project = {
version: "20.14.0",
};

export default (): std.Recipe<std.Directory> => {
function nodejs(): std.Recipe<std.Directory> {
let node = std
.download({
url: "https://nodejs.org/dist/v20.14.0/node-v20.14.0-linux-x64.tar.xz",
Expand All @@ -22,4 +22,18 @@ export default (): std.Recipe<std.Directory> => {
});

return std.withRunnableLink(node, "bin/node");
};
}
export default nodejs;

export function npmInstall(
pkg: std.AsyncRecipe<std.Directory>,
): std.Recipe<std.Directory> {
return std.runBash`
cd "$BRIOCHE_OUTPUT"
npm clean-install
`
.dependencies(nodejs())
.outputScaffold(pkg)
.unsafe({ networking: true })
.cast("directory");
}

0 comments on commit ff9bc62

Please sign in to comment.