mirror of
https://github.com/purocean/yn.git
synced 2026-10-13 07:38:54 +08:00
14 lines
383 B
JavaScript
14 lines
383 B
JavaScript
const cp = require('child_process');
|
|
|
|
exports.toWslPath = path => {
|
|
return cp.execFileSync('wslpath', ['-u', `${path.replace(/\\/g, '/')}`]).toString().trim()
|
|
}
|
|
|
|
exports.toWinPath = path => {
|
|
return cp.execFileSync('wslpath', ['-w', path]).toString().trim()
|
|
}
|
|
|
|
exports.getWinTempPath = () => {
|
|
return cp.execFileSync('cmd.exe', ['/c', 'echo %temp%']).toString().trim()
|
|
}
|