@sindresorhus/df
Advanced tools
Comparing version 2.0.0 to 2.1.0
12
index.js
@@ -32,2 +32,4 @@ 'use strict'; | ||
} | ||
throw new Error(`The specified filesystem \`${name}\` doesn't exist`); | ||
}); | ||
@@ -41,3 +43,11 @@ }; | ||
return run(['-kP', file]).then(data => data[0]); | ||
return run(['-kP', file]) | ||
.then(data => data[0]) | ||
.catch(err => { | ||
if (/No such file or directory/.test(err.message)) { | ||
err = new Error(`The specified file \`${file}\` doesn't exist`); | ||
} | ||
throw err; | ||
}); | ||
}; |
{ | ||
"name": "@sindresorhus/df", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Get free disk space info from `df -kP`", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -5,3 +5,3 @@ # df [![Build Status](https://travis-ci.org/sindresorhus/df.svg?branch=master)](https://travis-ci.org/sindresorhus/df) | ||
Works on any Unix based system like OS X and Linux. | ||
Works on any Unix based system like macOS and Linux. | ||
@@ -8,0 +8,0 @@ *Created because all the other `df` wrappers are terrible. This one uses simple and explicit parsing. Uses `execFile` rather than `exec`. Ensures better platform portability by using the `-P` flag. Returns sizes in bytes instead of kilobytes and the capacity as a float.* |
4769
42