Skip to content

Commit 7ae3653

Browse files
authored
chore: Merge in work done on old builder (#5)
From https://github.com/zeit/now-builders/pull/863
1 parent 714467a commit 7ae3653

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
},
1212
"scripts": {
1313
"build": "tsc",
14-
"test": "tsc && jest",
14+
"now-postinstall": "node dist/install-rust.js",
1515
"prepublishOnly": "tsc",
16+
"test": "tsc && jest",
1617
"typecheck": "tsc --noEmit"
1718
},
1819
"files": [

src/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
DownloadedFiles,
1515
Lambda
1616
} from "@now/build-utils"; // eslint-disable-line import/no-extraneous-dependencies
17-
import installRust from "./install-rust";
1817

1918
interface PackageManifest {
2019
targets: { kind: string; name: string }[];
@@ -275,10 +274,6 @@ export async function build(opts: BuildOptions) {
275274
const downloadedFiles = await download(files, workPath, meta);
276275
const entryPath = downloadedFiles[entrypoint].fsPath;
277276

278-
if (!meta.isDev) {
279-
await installRust(config.rust);
280-
}
281-
282277
const { PATH, HOME } = process.env;
283278
const rustEnv: Record<string, string> = {
284279
...process.env,

src/install-rust.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ async function installOpenSSL() {
3434
}
3535
}
3636

37-
export default async (version?: string) => {
37+
export const installRustAndFriends = async (version?: string) => {
3838
await downloadRustToolchain(version);
3939
await installOpenSSL();
4040
};
41+
42+
installRustAndFriends().catch(err => {
43+
console.error(err);
44+
process.exit(1);
45+
});

0 commit comments

Comments
 (0)