Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cross-platform parsing #48

Open
IgorShadurin opened this issue Jul 7, 2022 · 4 comments
Open

Use cross-platform parsing #48

IgorShadurin opened this issue Jul 7, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@IgorShadurin
Copy link
Contributor

FDS_REGISTRAR_ADDRESS=$(echo $DEPLOYMENT_OUTPUT | grep -Po 'FDSRegistrar deployed to: \K[^\s]*')

this command throw an error on mac os

grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
	[-e pattern] [-f file] [--binary-files=value] [--color=when]
	[--context[=num]] [--directories=action] [--label] [--line-buffered]
	[--null] [pattern] [file ...]

Info from stackoverflow

grep -P enables PCRE syntax. (This is a non-standard extension -- not even all builds of GNU grep support it, as it depends on the optional libpcre library, and whether to link this in is a compile-time option).

It would be great to replace it with some params that supported on mac os.

@crtahlin crtahlin added the bug Something isn't working label Aug 11, 2022
@crtahlin
Copy link

Please triage for urgency @nugaon .

@crtahlin
Copy link

Please add your planning poker estimate with ZenHub @nugaon

@nugaon
Copy link
Collaborator

nugaon commented Aug 22, 2022

it is not that urgent as this should be built by the github ci which uses Linux.

since I don't have mac to try out the mac solution, maybe @IgorShadurin could address this issue and find the solution that works on OSX as well.

@IgorShadurin
Copy link
Contributor Author

To extract the contract address from the DEPLOYMENT_OUTPUT variable on Mac and Ubuntu, use the awk command. This solution uses awk to match lines with the FDSRegistrar deployed to: string and prints the fourth field, which should be the contract address. Here's an example:

FDS_REGISTRAR_ADDRESS=$(echo $DEPLOYMENT_OUTPUT | awk '/FDSRegistrar deployed to:/ {print $4}')

But it should be tester with real data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants