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

Allow starting the CLI with an initial pwd set #23

Merged
merged 3 commits into from
Jul 6, 2023

Conversation

piotrMocz
Copy link
Collaborator

This was mentioned as a half-measure for #8 and it seems to cover a lot of the use cases (assuming users start drink-cli to mostly work on one contract.

Usage:

$ drink-cli --help
Usage: drink-cli [OPTIONS]

Options:
  -p, --path <DIRECTORY>  Starts the CLI in the provided directory
  -h, --help              Print help
  -V, --version           Print version

So you're able to start it like:

$ drink-cli examples/flipper

And immediately call build.

Copy link
Member

@pmikolajczyk41 pmikolajczyk41 left a comment

Choose a reason for hiding this comment

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

when I run: cargo run --release -- -p /home/<my local path>/drink/examples/flipper, optionally build the contract and try to deploy it, I get error about finding contract file

this helps:

fn find_wasm_blob(pwd: &PathBuf) -> Option<(String, PathBuf)> {
    let Ok(entries) = fs::read_dir(pwd.join("target/ink")) else {

drink-cli/src/app_state/mod.rs Outdated Show resolved Hide resolved
@piotrMocz piotrMocz merged commit 9c5bfb4 into main Jul 6, 2023
1 check passed
@piotrMocz piotrMocz deleted the feature/initial-path branch July 6, 2023 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants