pear-runtime-updater 0.0.9 → 0.0.10
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.
- package/index.js +3 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -10,7 +10,7 @@ const link = require('pear-link')
|
|
|
10
10
|
const hid = require('hypercore-id-encoding')
|
|
11
11
|
const { platform, arch } = require('which-runtime')
|
|
12
12
|
const isMobile = platform === 'ios' || platform === 'android'
|
|
13
|
-
const host =
|
|
13
|
+
const host = platform + '-' + arch
|
|
14
14
|
|
|
15
15
|
module.exports = class PearRuntime extends ReadyResource {
|
|
16
16
|
constructor(opts = {}) {
|
|
@@ -121,10 +121,11 @@ module.exports = class PearRuntime extends ReadyResource {
|
|
|
121
121
|
const local = new Localdrive(next)
|
|
122
122
|
|
|
123
123
|
this.emit('updating')
|
|
124
|
-
const prefix = `/by-arch/${host}/app
|
|
124
|
+
const prefix = `/by-arch/${host}/app${isMobile ? '' : `/${this.name}`}`
|
|
125
125
|
for await (const data of co.mirror(local, { prefix })) {
|
|
126
126
|
this.emit('updating-delta', data)
|
|
127
127
|
}
|
|
128
|
+
if (isMobile) await local.put(`${prefix}/package.json`, manifest)
|
|
128
129
|
|
|
129
130
|
await co.close()
|
|
130
131
|
await local.close()
|