mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
feat(publish): allow passing config flag (#22416)
This commit is contained in:
parent
981a19f067
commit
b5d122de32
2 changed files with 12 additions and 0 deletions
|
@ -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"),
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue