Skip to content

Commit

Permalink
chore: update sync script
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Mar 7, 2024
1 parent 31ad7e5 commit 948b75d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ await $`git remote rm slidev`
await $`git remote add slidev https://github.com/slidevjs/slidev`
await $`git fetch slidev main`

console.log('Timestamp of last commit:')
console.log('\nTimestamp of last commit:')
const { stdout: timestamp } = await $`git log -1 --format="%at" main`
console.log('Commits since last time:')
console.log('\nCommits since last time:')
const { stdout: hashes } = await $`git log --since="${+(timestamp.toString()) + 1}" slidev/main --format="%H"`

const firstHash = hashes.toString().trim().split('\n').at(-1)
Expand All @@ -24,5 +24,5 @@ if (!firstHash) {
}

const command = `git format-patch -k --stdout ${firstHash}...slidev/main --remove-empty -- docs | git am -3 -k --empty=drop`
console.log('Running command:', command)
await $(command)
console.log('\nRunning command:', command)
await $`git format-patch -k --stdout ${firstHash}...slidev/main --remove-empty -- docs | git am -3 -k --empty=drop`

0 comments on commit 948b75d

Please sign in to comment.