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

Support multiple init files #149

Closed
ethanfrey opened this issue Mar 19, 2020 · 3 comments · Fixed by #154
Closed

Support multiple init files #149

ethanfrey opened this issue Mar 19, 2020 · 3 comments · Fixed by #154
Assignees

Comments

@ethanfrey
Copy link
Contributor

If I have some generic setup code (helpers) and some contract-specific code (see #148) it would be nice to import both of them without merging the source files. This could be done if we support multiple instances of --init in packages/cli/src/cli.ts

export function main(originalArgs: readonly string[]): void {
  const parser = new ArgumentParser({ description: "The CosmWasm REPL" });
  parser.addArgument("--version", {
    action: "storeTrue",
    help: "Print version and exit",
  });
  parser.addArgument("--init", {
    metavar: "FILEPATH",
    help: "Read initial TypeScript code from file",
  });
  // ...
    if (args.init) {
    init += fs.readFileSync(args.init, "utf8") + "\n";
  }
@ethanfrey
Copy link
Contributor Author

@webmaster128 can you take a look at this? Since you wrote these cli arg parser.

I will be updating some examples (#147)

@webmaster128 webmaster128 self-assigned this Mar 19, 2020
@webmaster128
Copy link
Member

Sure, sounds like a simple change

@ethanfrey
Copy link
Contributor Author

Thanks

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 a pull request may close this issue.

2 participants