Skip to content

Commit

Permalink
adapter for harmony (#464)
Browse files Browse the repository at this point in the history
* update hvigorfile.ts file

* change versionName get logic

* change post logic for harmony
  • Loading branch information
bozaigao authored Jan 12, 2025
1 parent 2614277 commit 964d66d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Example/harmony_use_pushy/harmony/entry/hvigorfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down
5 changes: 4 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 964d66d

Please sign in to comment.