mirror of
https://github.com/amark/gun.git
synced 2025-11-24 14:35:55 +00:00
Update hub ! (#1134)
* Fix the "/" bug. * Update the "hub-test" to make them work everywhere!
This commit is contained in:
parent
edf6c5f38d
commit
0b158667a7
@ -57,7 +57,7 @@ function watch(what, options) {
|
|||||||
if (options.msg) log(`File ${path} has been added`);
|
if (options.msg) log(`File ${path} has been added`);
|
||||||
|
|
||||||
if(path[path.search(/^./gm)] === "/" || ".") {
|
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 {
|
} else {
|
||||||
gun.get('hub').get(modifiedPath + '/' + path).put(fs.readFileSync(path, 'utf-8'))
|
gun.get('hub').get(modifiedPath + '/' + path).put(fs.readFileSync(path, 'utf-8'))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,8 +2,8 @@
|
|||||||
// const gun = Gun();
|
// const gun = Gun();
|
||||||
|
|
||||||
// gun.get('hub').on(data => {
|
// 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');
|
const hub = require('../../lib/hub');
|
||||||
hub.watch('/home/noctisatrae/gun/test/hub', {msg: true, hubignore: true})
|
hub.watch(__dirname, {msg: true, hubignore: true})
|
||||||
Loading…
x
Reference in New Issue
Block a user