Skip to content

Commit 323bb30

Browse files
authored
fix: do not run lunaria when making a merge commit (#1440)
1 parent 0475e6f commit 323bb30

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
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()

0 commit comments

Comments
 (0)