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

docs: add one-liner tips #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,20 @@ This admin panel then reads in that Custom Section, decompresses the brotli, and

# Tips

## one-liners
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add that this is only supported in bash.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a similar syntax for zsh?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bash commands and syntax is compatible with zsh; one of the reasons I like it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok so "bash only" as opposed to what, then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@willemneal does this look good now?


Dev-deploy in one command:

near dev-deploy $(raen build --release -q)

Regular deploy in one command:

near deploy CONTRACT-NAME $(raen build --release -q)

Explanation: this uses [command subtitution](https://stackoverflow.com/a/19462303/249801) to put the output of `raen build` at the right spot in the `near [dev-]deploy` command. The `-q` option puts `raen build` in _quiet_ mode, meaning that it only outputs the location of the built file.

See `near dev-deploy --help`, `near deploy --help`, and `raen build --help` for more info.

## witgen macro

If you define a type that RAEN doesn't recognize (such as in this line `type Amount = Balance;` where RAEN doesn't recognize `Amount`), your build may result in an error like:
Expand Down