pear-prerelease 3.1.1 → 3.2.0
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 +18 -11
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -45,6 +45,10 @@ if (FROM && TO && PROD) {
|
|
|
45
45
|
const to = new Hyperdrive(store.namespace('release'), TO.drive.key, { compat: false })
|
|
46
46
|
await to.ready()
|
|
47
47
|
|
|
48
|
+
if (!to.core.writable) {
|
|
49
|
+
throw new Error('--to must be a writable drive')
|
|
50
|
+
}
|
|
51
|
+
|
|
48
52
|
const prod = new Hyperdrive(store.namespace('prod'), PROD.drive.key)
|
|
49
53
|
await prod.ready()
|
|
50
54
|
|
|
@@ -67,7 +71,8 @@ if (FROM && TO && PROD) {
|
|
|
67
71
|
|
|
68
72
|
prod.core.download()
|
|
69
73
|
|
|
70
|
-
|
|
74
|
+
const diff = '(' + to.core.length + '/' + prod.core.length + ')'
|
|
75
|
+
console.log('Copying in existing metadata data, might take a bit... ' + diff)
|
|
71
76
|
while (to.core.length < prod.core.length) {
|
|
72
77
|
await to.core.append(await prod.core.get(to.core.length))
|
|
73
78
|
console.log('Copied blocks', to.core.length, '/', prod.core.length)
|
|
@@ -76,17 +81,19 @@ if (FROM && TO && PROD) {
|
|
|
76
81
|
console.log()
|
|
77
82
|
|
|
78
83
|
await to.getBlobs()
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
if (prod.core.length > 0) {
|
|
85
|
+
await prod.getBlobs()
|
|
86
|
+
prod.blobs.core.download()
|
|
87
|
+
|
|
88
|
+
const diff = '(' + to.blobs.core.length + '/' + prod.blobs.core.length + ')'
|
|
89
|
+
console.log('Copying in existing blob data, might take a bit... ' + diff)
|
|
90
|
+
while (to.blobs.core.length < prod.blobs.core.length) {
|
|
91
|
+
await to.blobs.core.append(await prod.blobs.core.get(to.blobs.core.length))
|
|
92
|
+
console.log('Copied blob blocks', to.blobs.core.length, '/', prod.blobs.core.length)
|
|
93
|
+
}
|
|
94
|
+
console.log('Done!')
|
|
95
|
+
console.log()
|
|
87
96
|
}
|
|
88
|
-
console.log('Done!')
|
|
89
|
-
console.log()
|
|
90
97
|
|
|
91
98
|
const co = from.checkout(FROM.drive.length || from.core.length)
|
|
92
99
|
await co.ready()
|