版博士V2.0程序
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

22 righe
360 B

  1. const fs = require('fs')
  2. const paths = ['C:/libjpeg-turbo']
  3. if (process.arch === 'x64') {
  4. paths.unshift('C:/libjpeg-turbo64')
  5. }
  6. paths.forEach(function (path) {
  7. if (exists(path)) {
  8. process.stdout.write(path)
  9. process.exit()
  10. }
  11. })
  12. function exists (path) {
  13. try {
  14. return fs.lstatSync(path).isDirectory()
  15. } catch (e) {
  16. return false
  17. }
  18. }