Skip to content

Commit

Permalink
fix: --no-default-features flag was broken (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret authored Dec 5, 2023
1 parent 2f356fb commit fee9352
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
22 changes: 21 additions & 1 deletion deno.lock

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

16 changes: 16 additions & 0 deletions lib/args.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { assertEquals } from "https://deno.land/[email protected]/assert/mod.ts";
import { CommonBuild, parseArgs } from "./args.ts";

Deno.test("no default features", () => {
const args = parseArgs([
"--features",
"wasm",
"--no-default-features",
"--out",
"js",
]);
assertEquals(
(args as CommonBuild).cargoFlags,
["--no-default-features", "--features", "wasm"],
);
});
2 changes: 1 addition & 1 deletion lib/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export function parseArgs(rawArgs: string[]): Command {
function getCargoFlags() {
const cargoFlags = [];

if (flags["default-features"] === false) {
if (flags["no-default-features"]) {
cargoFlags.push("--no-default-features");
}
if (flags["features"]) {
Expand Down

0 comments on commit fee9352

Please sign in to comment.