Skip to content

Commit

Permalink
Merge branch 'main' into cyr/slide
Browse files Browse the repository at this point in the history
  • Loading branch information
brittcyr authored Aug 26, 2024
2 parents 1609b2c + b357551 commit c1185be
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions client/idl/generateClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,21 @@ async function main() {
{ stdio: 'inherit' },
);

// TODO: Also do the wrapper constant.
// Make sure the client has the correct fixed header size. Copy any
// other constants over as needed.
// Make sure the client has the correct fixed header size.
spawnSync(
"ORIGINAL_LINE=$(awk '/export const FIXED_MANIFEST_HEADER_SIZE: number = [-.0-9]+;/' client/ts/src/constants.ts); " +
'NEW_LINE=$(echo "export const FIXED_MANIFEST_HEADER_SIZE: number = ")$(awk \'/pub const MARKET_FIXED_SIZE: usize = [-.0-9]+;/\' programs/manifest/src/state/constants.rs | tr -d -c 0-9)$(echo ";"); ' +
'sed --debug -i "s/${ORIGINAL_LINE}/${NEW_LINE}/" client/ts/src/constants.ts',
[],
{ stdio: 'inherit' },
);
spawnSync(
"ORIGINAL_LINE=$(awk '/export const FIXED_WRAPPER_HEADER_SIZE: number = [-.0-9]+;/' client/ts/src/constants.ts); " +
'NEW_LINE=$(echo "export const FIXED_WRAPPER_HEADER_SIZE: number = ")$(awk \'/pub const WRAPPER_FIXED_SIZE: usize = [-.0-9]+;/\' programs/wrapper/src/wrapper_state.rs | tr -d -c 0-9)$(echo ";"); ' +
'sed --debug -i "s/${ORIGINAL_LINE}/${NEW_LINE}/" client/ts/src/constants.ts',
[],
{ stdio: 'inherit' },
);
});
});
}
Expand Down

0 comments on commit c1185be

Please sign in to comment.