@take-out/scripts 0.0.71 → 0.0.72
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/package.json +1 -1
- package/src/release.ts +21 -5
package/package.json
CHANGED
package/src/release.ts
CHANGED
|
@@ -305,17 +305,33 @@ async function syncOnZero() {
|
|
|
305
305
|
|
|
306
306
|
async function syncOnZeroIn() {
|
|
307
307
|
if (!(await fs.pathExists(onZeroGithub))) return
|
|
308
|
-
|
|
308
|
+
|
|
309
|
+
// check if there are commits after the last sync commit
|
|
310
|
+
const log = (await $`git -C ${onZeroGithub} log --oneline --format=%s`.text()).trim()
|
|
311
|
+
const commits = log.split('\n')
|
|
312
|
+
const lastSyncIdx = commits.findIndex((c) => c.startsWith('sync: from takeout'))
|
|
313
|
+
|
|
314
|
+
// no commits before sync, or first commit is a sync = nothing to pull in
|
|
315
|
+
if (lastSyncIdx <= 0) {
|
|
316
|
+
console.info(' ← on-zero: no new github commits to sync in')
|
|
317
|
+
return
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
const newCommits = commits.slice(0, lastSyncIdx).filter((c) => !c.match(/^v\d+\.\d+\.\d+/))
|
|
321
|
+
if (!newCommits.length) {
|
|
322
|
+
console.info(' ← on-zero: no new github commits to sync in')
|
|
323
|
+
return
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
console.info(` ← on-zero: syncing ${newCommits.length} commits from github`)
|
|
327
|
+
for (const c of newCommits) console.info(` ${c}`)
|
|
309
328
|
|
|
310
329
|
if (dryRun) {
|
|
311
330
|
console.info(' [dry-run] would copy src from github')
|
|
312
331
|
return
|
|
313
332
|
}
|
|
314
333
|
|
|
315
|
-
|
|
316
|
-
await fs.copy(join(onZeroGithub, 'src'), join(onZeroTakeout, 'src'), {
|
|
317
|
-
overwrite: true,
|
|
318
|
-
})
|
|
334
|
+
await fs.copy(join(onZeroGithub, 'src'), join(onZeroTakeout, 'src'), { overwrite: true })
|
|
319
335
|
|
|
320
336
|
const status = (await $`git status --porcelain`.text()).trim()
|
|
321
337
|
if (status) {
|