diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 824b73264f..59d7471670 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 2dbd854a72..b614005cce 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();