Fixed findmnt call

This commit is contained in:
Fabrice Marsaud 2016-03-03 12:30:45 +01:00
parent 2d791571d5
commit 628f9bd9b5

View File

@ -15,7 +15,7 @@ export default class NfsHandler extends LocalHandler {
let stdout let stdout
const mounted = {} const mounted = {}
try { try {
[stdout] = await execa('findmnt', ['-P', '-t', 'nfs,nfs4', '--output', 'SOURCE,TARGET', '--noheadings']) ({stdout} = await execa('findmnt', ['-P', '-t', 'nfs,nfs4', '--output', 'SOURCE,TARGET', '--noheadings']))
const regex = /^SOURCE="([^:]*):(.*)" TARGET="(.*)"$/ const regex = /^SOURCE="([^:]*):(.*)" TARGET="(.*)"$/
forEach(stdout.split('\n'), m => { forEach(stdout.split('\n'), m => {
if (m) { if (m) {
@ -28,6 +28,9 @@ export default class NfsHandler extends LocalHandler {
}) })
} catch (exc) { } catch (exc) {
// When no mounts are found, the call pretends to fail... // When no mounts are found, the call pretends to fail...
if (exc.stderr !== '') {
throw exc
}
} }
this._realMounts = mounted this._realMounts = mounted