mirror of
https://github.com/denoland/deno.git
synced 2024-11-25 15:29:32 -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")
|
.long("token")
|
||||||
.help("The API token to use when publishing. If unset, interactive authentication is be used")
|
.help("The API token to use when publishing. If unset, interactive authentication is be used")
|
||||||
)
|
)
|
||||||
|
.arg(config_arg())
|
||||||
|
.arg(no_config_arg())
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new("dry-run")
|
Arg::new("dry-run")
|
||||||
.long("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) {
|
fn publish_parse(flags: &mut Flags, matches: &mut ArgMatches) {
|
||||||
|
config_args_parse(flags, matches);
|
||||||
|
|
||||||
flags.subcommand = DenoSubcommand::Publish(PublishFlags {
|
flags.subcommand = DenoSubcommand::Publish(PublishFlags {
|
||||||
token: matches.remove_one("token"),
|
token: matches.remove_one("token"),
|
||||||
dry_run: matches.get_flag("dry-run"),
|
dry_run: matches.get_flag("dry-run"),
|
||||||
|
|
|
@ -196,6 +196,14 @@ itest!(dry_run {
|
||||||
http_server: true,
|
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]
|
#[test]
|
||||||
fn ignores_directories() {
|
fn ignores_directories() {
|
||||||
let context = publish_context_builder().build();
|
let context = publish_context_builder().build();
|
||||||
|
|
Loading…
Reference in a new issue