-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #162 from dappnode/tropicar/read-architecture-nati…
…vely Read architecture natively
- Loading branch information
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Architecture } from "../types"; | ||
import os from "os"; | ||
|
||
/** | ||
* Returns the architecture of the host machine doing the build | ||
*/ | ||
export function getArchitecture(): Architecture { | ||
// Returns the operating system CPU architecture for which the Node.js binary was compiled. | ||
const arch = os.arch(); | ||
|
||
// TODO: DAppNode Packages are run in Linux-based systems. This solves the edge case when building in ARM | ||
if (arch === "arm64") { | ||
return "linux/arm64"; | ||
} else { | ||
return "linux/amd64"; | ||
} | ||
} |