braidfs 0.0.77 → 0.0.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +4 -5
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -61,24 +61,24 @@ if (argv.length === 1 && argv[0].match(/^(run|serve)$/)) {
61
61
  } else if (argv.length && argv.length % 2 == 0 && argv.every((x, i) => i % 2 != 0 || x.match(/^(sync|unsync)$/))) {
62
62
  return (async () => {
63
63
  for (let i = 0; i < argv.length; i += 2) {
64
- var operation = argv[i],
64
+ var sync = argv[i] === 'sync',
65
65
  url = argv[i + 1]
66
66
  if (!url.match(/^https?:\/\//)) {
67
67
  if (url.startsWith('/')) url = require('path').relative(proxy_base, url)
68
68
  url = `https://${url}`
69
69
  }
70
- console.log(`${operation}ing ${url}`)
70
+ console.log(`${sync ? '' : 'un'}subscribing ${sync ? 'to' : 'from'} ${url}`)
71
71
  try {
72
72
  var res = await braid_fetch(`http://localhost:${config.port}/.braidfs/config`, {
73
73
  method: 'PUT',
74
74
  patches: [{
75
75
  unit: 'json',
76
76
  range: `sync[${JSON.stringify(url)}]`,
77
- content: operation === 'sync' ? 'true' : ''
77
+ content: sync ? 'true' : ''
78
78
  }]
79
79
  })
80
80
  if (res.ok) {
81
- console.log(`${operation}ed: ${url}`)
81
+ console.log(`Now ${sync ? '' : 'un'}subscribed ${sync ? 'to' : 'from'} ${url} in ~/http/.braidfs/config`)
82
82
  } else {
83
83
  console.log(`failed to ${operation} ${url}`)
84
84
  console.log(`server responded with ${res.status}: ${await res.text()}`)
@@ -91,7 +91,6 @@ You can run it with:
91
91
  return
92
92
  }
93
93
  }
94
- console.log('All operations completed successfully.')
95
94
  })()
96
95
  } else {
97
96
  return console.log(`Usage:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braidfs",
3
- "version": "0.0.77",
3
+ "version": "0.0.78",
4
4
  "description": "braid technology synchronizing files and webpages",
5
5
  "author": "Braid Working Group",
6
6
  "repository": "braid-org/braidfs",