@@ -2,12 +2,10 @@ const p = require('path')
22const { EventEmitter } = require ( 'events' )
33const crypto = require ( 'crypto' )
44
5- const hyperdrive = require ( 'hyperdrive' )
65const datEncoding = require ( 'dat-encoding' )
76const Stat = require ( 'hyperdrive/lib/stat' )
87const hyperfuse = require ( 'hyperdrive-fuse' )
98
10-
119const { rpc } = require ( 'hyperdrive-daemon-client' )
1210const { fromHyperdriveOptions, toHyperdriveOptions } = require ( 'hyperdrive-daemon-client/lib/common' )
1311const constants = require ( 'hyperdrive-daemon-client/lib/constants' )
@@ -59,7 +57,6 @@ class FuseManager extends EventEmitter {
5957 }
6058
6159 _wrapHandlers ( handlers ) {
62- const self = this
6360 const interceptorIndex = new Map ( )
6461
6562 const RootListHandler = {
@@ -96,7 +93,7 @@ class FuseManager extends EventEmitter {
9693 if ( ! match . groups [ 'key' ] ) {
9794 if ( op === 'readdir' ) return cb ( 0 , [ ] )
9895 if ( op === 'releasedir' ) return cb ( 0 )
99- if ( op === 'getattr' ) return cb ( 0 , Stat . directory ( { uid : process . getuid ( ) , gid : process . getgid ( ) } ) )
96+ if ( op === 'getattr' ) return cb ( 0 , Stat . directory ( { uid : process . getuid ( ) , gid : process . getgid ( ) } ) )
10097 return handlers [ op ] . apply ( null , [ ...args , cb ] )
10198 }
10299
@@ -204,7 +201,7 @@ class FuseManager extends EventEmitter {
204201
205202 function wrapHandler ( handlerName , handler ) {
206203 log . debug ( { handlerName } , 'wrapping handler' )
207- const activeInterceptors = interceptors . filter ( ( { ops } ) => ops === '*' || ( ops . indexOf ( handlerName ) !== - 1 ) )
204+ const activeInterceptors = interceptors . filter ( ( { ops } ) => ops === '*' || ( ops . indexOf ( handlerName ) !== - 1 ) )
208205 if ( ! activeInterceptors . length ) return handler
209206
210207 const matcher = new RegExp ( activeInterceptors . map ( ( { test, id } ) => `(?<${ id } >${ test } )` ) . join ( '|' ) )
@@ -239,7 +236,7 @@ class FuseManager extends EventEmitter {
239236 if ( ! this . _rootDrive && path !== constants . mountpoint ) {
240237 throw new Error ( `You can only mount the root drive at ${ constants . mountpoint } ` )
241238 }
242- if ( ! this . _rootDrive ) return { path : constants . mountpoint , root : true }
239+ if ( ! this . _rootDrive ) return { path : constants . mountpoint , root : true }
243240 if ( path . startsWith ( this . _rootMnt ) && path !== this . _rootMnt ) {
244241 const relativePath = path . slice ( this . _rootMnt . length )
245242 if ( ! relativePath . startsWith ( '/home' ) ) throw new Error ( 'You can only mount sub-hyperdrives within the home directory.' )
@@ -309,13 +306,13 @@ class FuseManager extends EventEmitter {
309306 }
310307
311308 async function mountRoot ( drive ) {
312- log . debug ( { key : drive . key . toString ( 'hex' ) } , 'mounting the root drive' )
309+ log . debug ( { key : drive . key . toString ( 'hex' ) } , 'mounting the root drive' )
313310 const fuseLogger = log . child ( { component : 'fuse' } )
314311
315312 const handlers = hyperfuse . getHandlers ( drive , mnt )
316313 const wrappedHandlers = self . _wrapHandlers ( handlers )
317314
318- var mountInfo = await hyperfuse . mount ( drive , wrappedHandlers , mnt , {
315+ await hyperfuse . mount ( drive , wrappedHandlers , mnt , {
319316 force : true ,
320317 displayFolder : true ,
321318 log : fuseLogger . trace . bind ( fuseLogger ) ,
0 commit comments