Skip to content

Commit c554b68

Browse files
committed
Added missing files
1 parent 52fd384 commit c554b68

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

bin/setup.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const p = require('path')
2+
const { spawn } = require('child_process')
3+
4+
const hyperfuse = require('hyperdrive-fuse')
5+
const ora = require('ora')
6+
const chalk = require('chalk')
7+
8+
exports.command = 'setup'
9+
exports.desc = 'Run a one-time configuration step for FUSE.'
10+
exports.handler = async function (argv) {
11+
console.log(chalk.blue('Configuring FUSE...'))
12+
const child = spawn('sudo', ['node', p.join(__dirname, '../scripts/configure.js')], {
13+
stdio: 'inherit'
14+
})
15+
child.on('exit', code => {
16+
if (code !== 0) return console.error(chalk.red(`Could not configure FUSE.`))
17+
console.log(chalk.green('Successfully configured FUSE!'))
18+
})
19+
}

scripts/configure.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const hyperfuse = require('hyperdrive-fuse')
2+
hyperfuse.configure(err => {
3+
if (err) return process.exit(1)
4+
return process.exit(0)
5+
})

0 commit comments

Comments
 (0)