diff options
author | Leo Kettmeir <crowlkats@toaxl.com> | 2024-02-14 18:13:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-14 17:13:07 +0000 |
commit | b5d122de32d075bc0a5b07ad18e9bcc1d2c07396 (patch) | |
tree | 5a3f969d87ec2f0b332d652b3aaafe9945f5679e | |
parent | 981a19f067169593d1f6ff8e374f24171f6bb70e (diff) |
feat(publish): allow passing config flag (#22416)
-rw-r--r-- | cli/args/flags.rs | 4 | ||||
-rw-r--r-- | tests/integration/publish_tests.rs | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 824b73264..59d747167 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -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") @@ -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"), diff --git a/tests/integration/publish_tests.rs b/tests/integration/publish_tests.rs index 2dbd854a7..b614005cc 100644 --- a/tests/integration/publish_tests.rs +++ b/tests/integration/publish_tests.rs @@ -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(); |