1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-09-16 08:41:37 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

adapter for harmony (#464)

* update hvigorfile.ts file

* change versionName get logic

* change post logic for harmony
This commit is contained in:
波仔糕
2025-01-12 12:17:54 +08:00
committed by GitHub
parent 261427705c
commit 964d66da74
2 changed files with 6 additions and 3 deletions

View File

@@ -14,11 +14,11 @@ export function generatePushyBuildTime(str?: string) {
if (!fs.existsSync(dirPath)) {
fs.mkdirSync(dirPath, { recursive: true });
}
const moduleJsonPath = path.resolve(__dirname, './oh-package.json5');
const moduleJsonPath = path.resolve(__dirname, '../AppScope/app.json5');
let versionName = '';
if (fs.existsSync(moduleJsonPath)) {
const moduleContent = fs.readFileSync(moduleJsonPath, 'utf-8');
const versionMatch = moduleContent.match(/"version":\s*"([^"]+)"/);
const versionMatch = moduleContent.match(/"versionName":\s*"([^"]+)"/);
if (versionMatch && versionMatch[1]) {
versionName = versionMatch[1];
}

View File

@@ -205,7 +205,10 @@ export class Pushy {
// @ts-ignore
delete fetchBody.buildTime;
}
const body = JSON.stringify(fetchBody);
let body = JSON.stringify(fetchBody);
if (Platform.OS === 'harmony') {
body = fetchBody;
}
const fetchPayload = {
method: 'POST',
headers: {