ccc-tnt-psd2ui/npm-packages/mac-v2.4.x/canvas/util/win_jpeg_lookup.js
2023-07-24 11:13:08 +08:00

22 lines
360 B
JavaScript

const fs = require('fs')
const paths = ['C:/libjpeg-turbo']
if (process.arch === 'x64') {
paths.unshift('C:/libjpeg-turbo64')
}
paths.forEach(function (path) {
if (exists(path)) {
process.stdout.write(path)
process.exit()
}
})
function exists (path) {
try {
return fs.lstatSync(path).isDirectory()
} catch (e) {
return false
}
}