@@ -39,13 +39,8 @@ export default defineCommand({
39
39
description : 'Regular expression to exclude matching keys' ,
40
40
required : false ,
41
41
} ,
42
- backup : {
43
- type : 'boolean' ,
44
- description : 'Create backup before cleaning' ,
45
- default : false ,
46
- } ,
47
42
} ,
48
- async run ( { args } : { args : { cwd ?: string , translationDir ?: string , logLevel ?: string , include ?: string , exclude ?: string , backup ?: boolean } } ) {
43
+ async run ( { args } : { args : { cwd ?: string , translationDir ?: string , logLevel ?: string , include ?: string , exclude ?: string } } ) {
49
44
const cwd = resolve ( ( args . cwd || '.' ) . toString ( ) )
50
45
51
46
const { locales, translationDir : defaultTranslationDir } = await getI18nConfig ( cwd , args . logLevel )
@@ -79,18 +74,6 @@ export default defineCommand({
79
74
return true
80
75
}
81
76
82
- // Функция для создания резервной копии
83
- const createBackup = ( filePath : string ) => {
84
- const backupDir = path . join ( translationDir , 'backups' )
85
- if ( ! fs . existsSync ( backupDir ) ) {
86
- fs . mkdirSync ( backupDir , { recursive : true } )
87
- }
88
- const timestamp = new Date ( ) . toISOString ( ) . replace ( / [: .] / g, '-' )
89
- const backupPath = path . join ( backupDir , `${ path . basename ( filePath ) } .${ timestamp } .bak` )
90
- fs . copyFileSync ( filePath , backupPath )
91
- consola . info ( `Created backup at ${ backupPath } ` )
92
- }
93
-
94
77
for ( const locale of locales ) {
95
78
const { code } = locale
96
79
const translationFilePath = path . join ( translationDir , `${ code } .json` )
@@ -100,11 +83,6 @@ export default defineCommand({
100
83
continue
101
84
}
102
85
103
- // Создаем резервную копию, если указана опция backup
104
- if ( args . backup ) {
105
- createBackup ( translationFilePath )
106
- }
107
-
108
86
let translations : Translations
109
87
try {
110
88
translations = loadJsonFile ( translationFilePath ) as Translations
0 commit comments