1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-25 16:49:18 -05:00

feat(publish): allow passing config flag (#22416)

This commit is contained in:
Leo Kettmeir 2024-02-14 18:13:07 +01:00 committed by GitHub
parent 981a19f067
commit b5d122de32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

View file

@ -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"),

View file

@ -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();