diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-02-01 09:59:09 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-02-02 02:30:01 +0000 |
| commit | 1cacf1bce77b88febc0cf9e2f0f9f468d4b30555 (patch) | |
| tree | 5c2c69336eddeb79082249a9167cc46e3c155f12 /src/sub_commands/claim.rs | |
| parent | 4b66c76a5a3ba878b4603d992353327807b8d8e6 (diff) | |
feat(repo_ref)!: use nip34 kind and tags
- change kind number
- do not rely on d identifiers for unique commit id. set it as default
to unique commit id shorthand.
- remove "r-" prefix from unique commit id r tag and instead add checks
for SHA1 validity
- rename tag git_server to clone
- add web tag
- use single relays tag instead of multiple relay tags
BREAKING CHANGE: change repo event kind and tags to reflect
nip34 draft. events with the older kind will no longer be found and will
not be in a valid format
Diffstat (limited to 'src/sub_commands/claim.rs')
| -rw-r--r-- | src/sub_commands/claim.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/sub_commands/claim.rs b/src/sub_commands/claim.rs index ce39a64..05ad961 100644 --- a/src/sub_commands/claim.rs +++ b/src/sub_commands/claim.rs | |||
| @@ -23,6 +23,9 @@ pub struct SubCommandArgs { | |||
| 23 | /// optional description | 23 | /// optional description |
| 24 | description: Option<String>, | 24 | description: Option<String>, |
| 25 | #[clap(short, long, value_parser, num_args = 1..)] | 25 | #[clap(short, long, value_parser, num_args = 1..)] |
| 26 | /// homepage | ||
| 27 | web: Vec<String>, | ||
| 28 | #[clap(short, long, value_parser, num_args = 1..)] | ||
| 26 | /// relays contributors push patches and comments to | 29 | /// relays contributors push patches and comments to |
| 27 | relays: Vec<String>, | 30 | relays: Vec<String>, |
| 28 | } | 31 | } |
| @@ -62,6 +65,15 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { | |||
| 62 | ) | 65 | ) |
| 63 | .context("no git remote origin configured")?; | 66 | .context("no git remote origin configured")?; |
| 64 | 67 | ||
| 68 | let web: Vec<String> = if args.web.is_empty() { | ||
| 69 | Interactor::default() | ||
| 70 | .input(PromptInputParms::default().with_prompt("description (Optional)"))? | ||
| 71 | .split(' ') | ||
| 72 | .map(std::string::ToString::to_string) | ||
| 73 | .collect() | ||
| 74 | } else { | ||
| 75 | args.web.clone() | ||
| 76 | }; | ||
| 65 | #[cfg(not(test))] | 77 | #[cfg(not(test))] |
| 66 | let mut client = Client::default(); | 78 | let mut client = Client::default(); |
| 67 | #[cfg(test)] | 79 | #[cfg(test)] |
| @@ -120,10 +132,12 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { | |||
| 120 | println!("publishing repostory reference..."); | 132 | println!("publishing repostory reference..."); |
| 121 | 133 | ||
| 122 | let repo_event = RepoRef { | 134 | let repo_event = RepoRef { |
| 135 | identifier: root_commit.to_string()[..7].to_string(), | ||
| 123 | name, | 136 | name, |
| 124 | description, | 137 | description, |
| 125 | root_commit: root_commit.to_string(), | 138 | root_commit: root_commit.to_string(), |
| 126 | git_server, | 139 | git_server, |
| 140 | web, | ||
| 127 | relays: repo_relays.clone(), | 141 | relays: repo_relays.clone(), |
| 128 | maintainers, | 142 | maintainers, |
| 129 | } | 143 | } |