From 3e5e9e8106cc6f1a7c6ea942508e1e5dd7dd163b Mon Sep 17 00:00:00 2001 From: Mathias Buus Date: Tue, 17 Dec 2019 10:15:33 +0100 Subject: [PATCH] add bin --- bin.js | 20 ++++++++++++++++++++ package.json | 3 +++ 2 files changed, 23 insertions(+) create mode 100755 bin.js diff --git a/bin.js b/bin.js new file mode 100755 index 0000000..b91de24 --- /dev/null +++ b/bin.js @@ -0,0 +1,20 @@ +#!/usr/bin/env node + +const Fuse = require('./') +const cmd = process.argv[2] + +if (cmd === 'configure') { + Fuse.configure(onerror) +} else if (cmd === 'unconfigure') { + Fuse.unconfigure(onerror) +} else if (cmd === 'is-configured') { + Fuse.isConfigured(function (err, bool) { + if (err) return onerror(err) + console.log('' + bool) + process.exit(bool ? 0 : 1) + }) +} + +function onerror (err) { + if (err) throw err +} diff --git a/package.json b/package.json index 7b5b620..eb5b75e 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,9 @@ "version": "0.0.0", "description": "Fully maintained fuse bindings for Node that aims to cover the entire FUSE api", "main": "index.js", + "bin": { + "fuse-native": "./bin.js" + }, "scripts": { "install": "node-gyp-build", "test": "tape test/*.js",