Skip to content

Commit

Permalink
minor adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
weezy20 committed Mar 8, 2024
1 parent 7e81cc2 commit 69d9491
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
7 changes: 3 additions & 4 deletions src/commands/add/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub(crate) struct AddArgs {
/// Pallet to add to the runtime
pub(crate) pallet: AddPallet,
#[arg(global = true, short, long)]
/// Runtime path;
/// Runtime path; for example: `sub0/runtime/src/lib.rs`
/// Cargo Manifest path will be inferred as `../Cargo.toml`
pub(crate) runtime: Option<String>,
}
Expand All @@ -37,9 +37,8 @@ impl AddArgs {
let runtime_path = match self.runtime {
Some(ref s) => {
let path = PathBuf::from(s);
// println!("Using runtime path: {}", &path.display());
if !path.exists() {
anyhow::bail!("Runtime path does not exist: {}", path.display());
anyhow::bail!("Invalid runtime path: {}", path.display());
}
path
}
Expand All @@ -52,7 +51,7 @@ impl AddArgs {
}
};
let pallet = match self.pallet {
AddPallet::Template => format!("pallet-template"),
AddPallet::Template => format!("pallet-parachain-template"),
AddPallet::Frame(FrameArgs { .. }) => {
eprintln!("Sorry, frame pallets cannot be added right now");
std::process::exit(1);
Expand Down
7 changes: 1 addition & 6 deletions src/engines/pallet_engine/steps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ pub(super) enum Steps {
/// PalletEngine State transitions
SwitchTo(State),
}

macro_rules! steps {
($cmd:expr) => {
steps.push($cmd);
};
}
/// Some rules to follow when constructing steps:
/// The pallet engine state expects to go as edits would, i.e. top to bottom lexically
/// So it makes sense for any given file, to first include an import, then items that refer to it
Expand All @@ -47,6 +41,7 @@ pub(super) fn step_builder(pallet: AddPallet) -> Result<Vec<Steps>> {
AddPallet::Template => {
// steps.push(RuntimePalletDependency(Dependency::runtime_template()));
steps.push(RuntimePalletImport(quote!(
// Imports by pop-cli
pub use pallet_parachain_template;
)));
steps.push(SwitchTo(State::Config));
Expand Down

0 comments on commit 69d9491

Please sign in to comment.