summaryrefslogtreecommitdiff
path: root/cli/js/build.ts
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2020-04-28 12:35:23 -0400
committerGitHub <noreply@github.com>2020-04-28 12:35:23 -0400
commite0ca60e7707b5896ce67301aefd1de4a76e3cf75 (patch)
tree4c5357a3d3482b14cbc3773374aa885e1e29e90c /cli/js/build.ts
parentf7ab19b1b7ba929f7fd1550e2e4ecebe91cd9ea3 (diff)
BREAKING: Use LLVM target triple for Deno.build (#4948)
Deno.build.os values have changed to correspond to standard LLVM target triples "win" -> "windows" "mac" -> "darwin"
Diffstat (limited to 'cli/js/build.ts')
-rw-r--r--cli/js/build.ts29
1 files changed, 12 insertions, 17 deletions
diff --git a/cli/js/build.ts b/cli/js/build.ts
index f00c5b463..676e056eb 100644
--- a/cli/js/build.ts
+++ b/cli/js/build.ts
@@ -1,24 +1,19 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
-export type OperatingSystem = "mac" | "win" | "linux";
-
-export type Arch = "x64" | "arm64";
-
-// Do not add unsupported platforms.
-export interface BuildInfo {
- arch: Arch;
-
- os: OperatingSystem;
-}
-
-export const build: BuildInfo = {
- arch: "" as Arch,
- os: "" as OperatingSystem,
+export const build = {
+ target: "unknown",
+ arch: "unknown",
+ os: "unknown",
+ vendor: "unknown",
+ env: undefined as string | undefined,
};
-export function setBuildInfo(os: OperatingSystem, arch: Arch): void {
- build.os = os;
+export function setBuildInfo(target: string): void {
+ const [arch, vendor, os, env] = target.split("-", 4);
+ build.target = target;
build.arch = arch;
-
+ build.vendor = vendor;
+ build.os = os;
+ build.env = env;
Object.freeze(build);
}