Skip to content

Commit

Permalink
New release (#35)
Browse files Browse the repository at this point in the history
* measure cycles from __get_cycles

* bump

* display command when executing script

* ux improve

Co-authored-by: Yan Chen <yan.chen@dfinity.org>
  • Loading branch information
chenyan2002 and chenyan-dfinity authored Sep 6, 2022
1 parent 9f163ef commit c946f70
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 68 deletions.
81 changes: 41 additions & 40 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ic-repl"
version = "0.3.1"
version = "0.3.2"
authors = ["DFINITY Team"]
edition = "2018"

Expand Down
7 changes: 4 additions & 3 deletions src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ use anyhow::{anyhow, Context};
use candid::{parser::configs::Configs, parser::value::IDLValue, Principal, TypeEnv};
use ic_agent::Agent;
use pretty_assertions::{assert_eq, assert_ne};
use std::ops::Range;
use std::path::{Path, PathBuf};
use std::sync::Arc;
use std::time::Instant;
use terminal_size::{terminal_size, Width};

#[derive(Debug, Clone)]
pub struct Commands(pub Vec<Command>);
pub struct Commands(pub Vec<(Command, Range<usize>)>);
#[derive(Debug, Clone)]
pub enum Command {
Config(String),
Expand Down Expand Up @@ -189,8 +190,8 @@ impl Command {
}
let cmds = pretty_parse::<Commands>(&file, &script)?;
helper.base_path = path.parent().unwrap().to_path_buf();
for cmd in cmds.0.into_iter() {
//println!("> {:?}", cmd);
for (cmd, pos) in cmds.0.into_iter() {
println!("> {}", &script[pos]);
cmd.run(helper)?;
}
helper.base_path = old_base;
Expand Down
Loading

0 comments on commit c946f70

Please sign in to comment.