Skip to content

Commit

Permalink
feat(publish): allow passing config flag (#22416)
Browse files Browse the repository at this point in the history
  • Loading branch information
crowlKats committed Feb 14, 2024
1 parent 981a19f commit b5d122d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cli/args/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2379,6 2379,8 @@ fn publish_subcommand() -> Command {
.long("token")
.help("The API token to use when publishing. If unset, interactive authentication is be used")
)
.arg(config_arg())
.arg(no_config_arg())
.arg(
Arg::new("dry-run")
.long("dry-run")
Expand Down Expand Up @@ -3821,6 3823,8 @@ fn vendor_parse(flags: &mut Flags, matches: &mut ArgMatches) {
}

fn publish_parse(flags: &mut Flags, matches: &mut ArgMatches) {
config_args_parse(flags, matches);

flags.subcommand = DenoSubcommand::Publish(PublishFlags {
token: matches.remove_one("token"),
dry_run: matches.get_flag("dry-run"),
Expand Down
8 changes: 8 additions & 0 deletions tests/integration/publish_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 196,14 @@ itest!(dry_run {
http_server: true,
});

itest!(config_flag {
args: "publish --token 'sadfasdf' --config=successful/deno.json",
output: "publish/successful.out",
cwd: Some("publish"),
envs: env_vars_for_jsr_tests(),
http_server: true,
});

#[test]
fn ignores_directories() {
let context = publish_context_builder().build();
Expand Down

0 comments on commit b5d122d

Please sign in to comment.