Skip to content

Commit 2aced54

Browse files
committed
hyperdrive-fuse should be an optional dep
1 parent f2379ac commit 2aced54

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

bin/setup.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@ const p = require('path')
22
const fs = require('fs')
33
const { spawn, exec } = require('child_process')
44

5-
const hyperfuse = require('hyperdrive-fuse')
5+
try {
6+
var hyperfuse = require('hyperdrive-fuse')
7+
} catch (err) {
8+
console.warn('FUSE installation failed. You will be unable to mount your hyperdrives.')
9+
}
10+
611
const ora = require('ora')
712
const chalk = require('chalk')
813

914
exports.command = 'setup'
1015
exports.desc = 'Run a one-time configuration step for FUSE.'
1116
exports.handler = async function (argv) {
17+
if (!hyperfuse) return onerror('FUSE installation failed.')
18+
1219
console.log(chalk.blue('Configuring FUSE...'))
1320

1421
configureFuse((err, fuseMsg) => {

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
"google-protobuf": "^3.8.0",
3838
"hyperdrive": "^10.0.0-rc7",
3939
"hyperdrive-daemon-client": "^0.9.10",
40-
"hyperdrive-fuse": "^1.1.0",
4140
"level": "^4.0.0",
4241
"mkdirp": "^0.5.1",
4342
"ora": "^3.4.0",
@@ -49,6 +48,9 @@
4948
"subleveldown": "^4.0.0",
5049
"yargs": "^13.2.1"
5150
},
51+
"optionalDependencies": {
52+
"hyperdrive-fuse": "^1.1.0"
53+
},
5254
"devDependencies": {
5355
"memdb": "^1.3.1",
5456
"random-access-memory": "^3.1.1",

0 commit comments

Comments
 (0)