index.js 500 B

12345678910111213141516171819202122
  1. "use strict"
  2. const path = require("path")
  3. function getPath() {
  4. if (process.env.USE_SYSTEM_7ZA === "true") {
  5. return "7za"
  6. }
  7. if (process.platform === "darwin") {
  8. return path.join(__dirname, "mac", process.arch, "7za")
  9. }
  10. else if (process.platform === "win32") {
  11. return path.join(__dirname, "win", process.arch, "7za.exe")
  12. }
  13. else {
  14. return path.join(__dirname, "linux", process.arch, "7za")
  15. }
  16. }
  17. exports.path7za = getPath()
  18. exports.path7x = path.join(__dirname, "7x.sh")