index.js 956 B

1234567891011121314151617181920212223242526272829303132
  1. "use strict"
  2. const path = require("path")
  3. function getPath() {
  4. if (process.env.USE_SYSTEM_APP_BUILDER === "true") {
  5. return "app-builder"
  6. }
  7. const platform = process.platform;
  8. const arch = process.arch
  9. if (platform === "darwin") {
  10. return path.join(__dirname, "mac", `app-builder_${arch === "x64" ? "amd64" : arch}`)
  11. }
  12. else if (platform === "win32" && arch === "arm64") {
  13. /**
  14. * Golang isn't available for Windows ARM64 yet, so an ARM64 binary
  15. * can't be built yet. However, Windows ARM64 does support ia32
  16. * emulation, so we can leverage the existing executable for ia32.
  17. * https://github.com/golang/go/issues/36439
  18. */
  19. return path.join(__dirname, "win", "ia32", "app-builder.exe")
  20. }
  21. else if (platform === "win32") {
  22. return path.join(__dirname, "win", arch, "app-builder.exe")
  23. }
  24. else {
  25. return path.join(__dirname, "linux", arch, "app-builder")
  26. }
  27. }
  28. exports.appBuilderPath = getPath()