Skip to content

Commit 757b1fc

Browse files
committed
fix: try skipping lunaria when merging
1 parent 0b444da commit 757b1fc

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lunaria/lunaria.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
import { createLunaria } from '@lunariajs/core'
2-
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs'
2+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'
33
import { Page } from './components.ts'
44
import { lunariaJSONFiles, prepareJsonFiles } from './prepare-json-files.ts'
55
import type { I18nStatus } from '../shared/types/i18n-status.ts'
66

7+
// skip lunaria during git merges as git history may be in an inconsistent state.
8+
if (existsSync('.git/MERGE_HEAD')) {
9+
// eslint-disable-next-line no-console
10+
console.log('Skipping lunaria: git merge in progress')
11+
process.exit(0)
12+
}
13+
714
await prepareJsonFiles()
815

916
const lunaria = await createLunaria()

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
"node": "24"
146146
},
147147
"simple-git-hooks": {
148-
"pre-commit": "[ -n \"$NO_VERIFY\" ] && exit 0\nnpx lint-staged"
148+
"pre-commit": "npx lint-staged"
149149
},
150150
"lint-staged": {
151151
"i18n/locales/*": [

0 commit comments

Comments
 (0)