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

more cresc config

This commit is contained in:
sunnylqm
2025-02-18 22:37:09 +08:00
parent e713f4bbd1
commit 546faef83f
3 changed files with 29 additions and 17 deletions

6
src/utils/constants.ts Normal file
View File

@@ -0,0 +1,6 @@
export const credentialFile = global.IS_CRESC ? '.cresc.token' : '.update';
export const updateJson = global.IS_CRESC ? 'cresc.config.json' : 'update.json';
export const tempDir = global.IS_CRESC ? '.cresc.temp' : '.pushy';
export const pricingPageUrl = global.IS_CRESC
? 'https://cresc.dev/pricing'
: 'https://pushy.reactnative.cn/pricing.html';

View File

@@ -9,8 +9,9 @@ import latestVersion from '@badisi/latest-version';
import { checkPlugins } from './check-plugin';
import { read } from 'read';
import { tempDir } from './constants';
export async function question(query, password) {
export async function question(query: string, password: boolean) {
if (NO_INTERACTIVE) {
return '';
}
@@ -21,7 +22,7 @@ export async function question(query, password) {
});
}
export function translateOptions(options) {
export function translateOptions(options: Record<string, string>) {
const ret = {};
for (const key in options) {
const v = options[key];
@@ -163,16 +164,16 @@ export async function getIpaInfo(fn: string) {
return { versionName, buildTime, ...appCredential };
}
const localDir = path.resolve(os.homedir(), '.pushy');
const localDir = path.resolve(os.homedir(), tempDir);
fs.ensureDirSync(localDir);
export function saveToLocal(originPath, destName) {
export function saveToLocal(originPath: string, destName: string) {
// TODO
// const destPath = path.join(localDir, destName);
// fs.ensureDirSync(path.dirname(destPath));
// fs.copyFileSync(originPath, destPath);
}
async function getLatestVersion(pkgName) {
async function getLatestVersion(pkgName: string) {
return Promise.race([
latestVersion(pkgName)
.then((p) => p.latest)
@@ -225,6 +226,6 @@ export async function printVersionCommand() {
}
}
export const pricingPageUrl = 'https://pushy.reactnative.cn/pricing.html';
export { checkPlugins };