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

--out-dir should be relative to current directory #704

Closed
mwillsey opened this issue Aug 19, 2019 · 1 comment · May be fixed by #712
Closed

--out-dir should be relative to current directory #704

mwillsey opened this issue Aug 19, 2019 · 1 comment · May be fixed by #712
Labels
PR attached there's a PR open for this issue user report

Comments

@mwillsey
Copy link

🐛 Bug description

wasm-pack build subdir/ --out-dir pkg dumps the output in $PWD/subdir/pkg/.

🤔 Expected Behavior

Should output to $PWD/pkg, not the subdir. The help says:

-d, --out-dir <out_dir> Sets the output directory with a relative path. [default: pkg]
--out-name <out_name> Sets the output file names. Defaults to package name.

My understanding is that "relative" here means relative to the current working directory.

👟 Steps to reproduce

wasm-pack build subdir/ --out-dir pkg

🌍 Your environment

$ wasm-pack --version
wasm-pack 0.8.1

My use case here is working in a cargo workspace. I like to work in the top-level directory, and keep all of my build artifacts in the top-level target/ directory.

Thanks!

@nalshihabi
Copy link

This seems to result from this line in src/command/build.rs.

let out_dir = crate_path.join(PathBuf::from(build_opts.out_dir));

The out_dir path is joined with the crate path. I imagine this can be fixed by just removing the join. I can make the changes if that is wanted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR attached there's a PR open for this issue user report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants