diff --git a/lib/hub.js b/lib/hub.js index 58ff6adb..94ceff14 100644 --- a/lib/hub.js +++ b/lib/hub.js @@ -57,7 +57,7 @@ function watch(what, options) { if (options.msg) log(`File ${path} has been added`); if(path[path.search(/^./gm)] === "/" || ".") { - gun.get('hub').get(modifiedPath + path).put(fs.readFileSync(path, 'utf-8')) + gun.get('hub').get(modifiedPath + '/' + path).put(fs.readFileSync(path, 'utf-8')) } else { gun.get('hub').get(modifiedPath + '/' + path).put(fs.readFileSync(path, 'utf-8')) } diff --git a/test/hub/hub-test.js b/test/hub/hub-test.js index 9687b92a..2515a408 100644 --- a/test/hub/hub-test.js +++ b/test/hub/hub-test.js @@ -2,8 +2,8 @@ // const gun = Gun(); // gun.get('hub').on(data => { -// console.log(data['/home/noctisatrae/gun/test/hub/index.html']) +// console.log(data[`${__dirname}/index.html`]) // }) const hub = require('../../lib/hub'); -hub.watch('/home/noctisatrae/gun/test/hub', {msg: true, hubignore: true}) \ No newline at end of file +hub.watch(__dirname, {msg: true, hubignore: true}) \ No newline at end of file