machinepack-fs
Advanced tools
Comparing version 1.2.1 to 1.3.0
@@ -19,2 +19,5 @@ module.exports = { | ||
error: {}, | ||
doesNotExist: { | ||
description: 'No file exists at the provided `source` path' | ||
}, | ||
success: { | ||
@@ -30,3 +33,9 @@ example: 'stuff in a file!' | ||
fsx.readFile(inputs.source, function (err, contents) { | ||
if (err) return exits.error(err); | ||
if (err) { | ||
if (typeof err === 'object' && err.code === 'ENOENT') { | ||
return exits.doesNotExist(); | ||
} | ||
// Some unrecognized error | ||
return exits.error(err); | ||
} | ||
return exits.success(contents); | ||
@@ -33,0 +42,0 @@ }); |
{ | ||
"name": "machinepack-fs", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "Work with the local filesystem; list files, write files, etc.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
10525
296