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

use std::path::Path[Buf] and join for paths #213

Closed
Mackiovello opened this issue Jul 14, 2018 · 4 comments · Fixed by #220
Closed

use std::path::Path[Buf] and join for paths #213

Mackiovello opened this issue Jul 14, 2018 · 4 comments · Fixed by #220
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@Mackiovello
Copy link
Contributor

$ cargo run -- init myproject/
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s
     Running `target/debug/wasm-pack init myproject/`

  [1/8] Checking crate configuration...
  [2/8] Adding WASM target...
  [3/8] Compiling to WASM...
  [4/8] Creating a pkg directory...
  [5/8] Writing a package.json...
  :-) [WARN]: Field description is missing from Cargo.toml. It is not necessary, but recommended
  :-) [WARN]: Field repository is missing from Cargo.toml. It is not necessary, but recommended
  :-) [WARN]: Field license is missing from Cargo.toml. It is not necessary, but recommended
  [6/8] Copying over your README...
  :-) [WARN]: origin crate has no README
  [7/8] Installing WASM-bindgen...
  [8/8] Running WASM-bindgen...
  :-) Done in 2 minutes
| :-) Your WASM pkg is ready to publish at myproject//pkg.

In the last line it says "Your WASM pkg is ready to publish at myproject//pkg.". It should probably just be "myproject/pkg".

This is on Linux.

@Mackiovello
Copy link
Contributor Author

The issue is only when the path has a trailing forward slash. Would it make sense to trim this in set_crate_path?

Since we probably have this issue in a number of places where we do {}/pkg, I think that's the way to deal with it.

@fitzgen
Copy link
Member

fitzgen commented Jul 14, 2018

Long term, I think a lot of places should start using std::path::Path[Buf] in wasm-pack, and then we could use the join method instead of {}/pkg.

@ashleygwilliams ashleygwilliams added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels Jul 16, 2018
@ashleygwilliams ashleygwilliams changed the title Extra forward slash in output from wasm-init use std::path::Path[Buf] and join for paths Jul 16, 2018
@ashleygwilliams ashleygwilliams added this to the 0.5.0 milestone Jul 16, 2018
@ashleygwilliams
Copy link
Member

strong agree with @fitzgen. have renamed this issue to that plan. PRs welcome!

@Mackiovello
Copy link
Contributor Author

PRs welcome!

I'd love to take this one! It seems to be on my level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants