mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-09-16 10:21:37 +08:00
adapter for harmony (#464)
* update hvigorfile.ts file * change versionName get logic * change post logic for harmony
This commit is contained in:
@@ -14,11 +14,11 @@ export function generatePushyBuildTime(str?: string) {
|
|||||||
if (!fs.existsSync(dirPath)) {
|
if (!fs.existsSync(dirPath)) {
|
||||||
fs.mkdirSync(dirPath, { recursive: true });
|
fs.mkdirSync(dirPath, { recursive: true });
|
||||||
}
|
}
|
||||||
const moduleJsonPath = path.resolve(__dirname, './oh-package.json5');
|
const moduleJsonPath = path.resolve(__dirname, '../AppScope/app.json5');
|
||||||
let versionName = '';
|
let versionName = '';
|
||||||
if (fs.existsSync(moduleJsonPath)) {
|
if (fs.existsSync(moduleJsonPath)) {
|
||||||
const moduleContent = fs.readFileSync(moduleJsonPath, 'utf-8');
|
const moduleContent = fs.readFileSync(moduleJsonPath, 'utf-8');
|
||||||
const versionMatch = moduleContent.match(/"version":\s*"([^"]+)"/);
|
const versionMatch = moduleContent.match(/"versionName":\s*"([^"]+)"/);
|
||||||
if (versionMatch && versionMatch[1]) {
|
if (versionMatch && versionMatch[1]) {
|
||||||
versionName = versionMatch[1];
|
versionName = versionMatch[1];
|
||||||
}
|
}
|
||||||
|
@@ -205,7 +205,10 @@ export class Pushy {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
delete fetchBody.buildTime;
|
delete fetchBody.buildTime;
|
||||||
}
|
}
|
||||||
const body = JSON.stringify(fetchBody);
|
let body = JSON.stringify(fetchBody);
|
||||||
|
if (Platform.OS === 'harmony') {
|
||||||
|
body = fetchBody;
|
||||||
|
}
|
||||||
const fetchPayload = {
|
const fetchPayload = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
Reference in New Issue
Block a user