Skip to content

Commit 964d66d

Browse files
authored
adapter for harmony (#464)
* update hvigorfile.ts file * change versionName get logic * change post logic for harmony
1 parent 2614277 commit 964d66d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Example/harmony_use_pushy/harmony/entry/hvigorfile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ export function generatePushyBuildTime(str?: string) {
1414
if (!fs.existsSync(dirPath)) {
1515
fs.mkdirSync(dirPath, { recursive: true });
1616
}
17-
const moduleJsonPath = path.resolve(__dirname, './oh-package.json5');
17+
const moduleJsonPath = path.resolve(__dirname, '../AppScope/app.json5');
1818
let versionName = '';
1919
if (fs.existsSync(moduleJsonPath)) {
2020
const moduleContent = fs.readFileSync(moduleJsonPath, 'utf-8');
21-
const versionMatch = moduleContent.match(/"version":\s*"([^"]+)"/);
21+
const versionMatch = moduleContent.match(/"versionName":\s*"([^"]+)"/);
2222
if (versionMatch && versionMatch[1]) {
2323
versionName = versionMatch[1];
2424
}

src/client.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,10 @@ export class Pushy {
205205
// @ts-ignore
206206
delete fetchBody.buildTime;
207207
}
208-
const body = JSON.stringify(fetchBody);
208+
let body = JSON.stringify(fetchBody);
209+
if (Platform.OS === 'harmony') {
210+
body = fetchBody;
211+
}
209212
const fetchPayload = {
210213
method: 'POST',
211214
headers: {

0 commit comments

Comments
 (0)