1
0
mirror of https://gitcode.com/github-mirrors/react-native-update-cli.git synced 2025-10-30 22:33:11 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
sunnylqm
2025-03-15 18:33:05 +08:00
parent d0495fb271
commit d974be6706
10 changed files with 257 additions and 79 deletions

View File

@@ -30,7 +30,7 @@ function mapInfoResource (apkInfo, resourceMap) {
iteratorObj(apkInfo)
return apkInfo
function iteratorObj (obj) {
for (var i in obj) {
for (const i in obj) {
if (isArray(obj[i])) {
iteratorArray(obj[i])
} else if (isObject(obj[i])) {

28
src/utils/i18n.ts Normal file
View File

@@ -0,0 +1,28 @@
import i18next from 'i18next';
import en from '../locales/en';
import zh from '../locales/zh';
import { IS_CRESC } from './constants';
i18next.init({
lng: IS_CRESC ? 'en' : 'zh',
// debug: process.env.NODE_ENV !== 'production',
resources: {
en,
zh,
},
});
declare module 'i18next' {
// Extend CustomTypeOptions
interface CustomTypeOptions {
// custom namespace type, if you changed it
defaultNS: 'en';
// custom resources type
resources: {
en: typeof en;
zh: typeof zh;
};
// other
}
}
export const t = i18next.t;

View File

@@ -11,6 +11,7 @@ import { checkPlugins } from './check-plugin';
import { read } from 'read';
import { tempDir } from './constants';
import { depVersions } from './dep-versions';
import { getCommitInfo } from './git';
export async function question(query: string, password?: boolean) {
if (NO_INTERACTIVE) {
@@ -168,6 +169,8 @@ async function getLatestVersion(pkgNames: string[]) {
}
export async function printVersionCommand() {
const result = await getCommitInfo();
console.log(JSON.stringify(result, null, 2));
let [latestPushyCliVersion, latestPushyVersion] = await getLatestVersion([
'react-native-update-cli',
'react-native-update',