···456456457457#[derive(Subcommand, Debug)]
458458enum Owner {
459459- /// Transfers ownership of this package to a new Hex user
459459+ /// Transfers ownership of the given package to a new Hex user
460460 ///
461461 /// This command uses this environment variable:
462462 ///
···464464 ///
465465 #[command(verbatim_doc_comment)]
466466 Transfer {
467467+ package: String,
468468+467469 /// The username or email of the new owner
468470 #[arg(long = "to")]
469471 username_or_email: String,
···675677 hex::revert(&paths, package, version)
676678 }
677679678678- Command::Hex(Hex::Owner(Owner::Transfer { username_or_email })) => {
679679- let paths = find_project_paths()?;
680680- owner::transfer(&paths, username_or_email)
681681- }
680680+ Command::Hex(Hex::Owner(Owner::Transfer {
681681+ package,
682682+ username_or_email,
683683+ })) => owner::transfer(package, username_or_email),
682684683685 Command::Add { packages, dev } => {
684686 let paths = find_project_paths()?;
···11use crate::{cli, http::HttpClient};
22-use gleam_core::{Result, hex, paths::ProjectPaths};
22+use gleam_core::{Result, hex};
33use std::time::Instant;
4455-pub fn transfer(paths: &ProjectPaths, new_owner_username_or_email: String) -> Result<()> {
66- let config = crate::config::root_config(paths)?;
55+pub fn transfer(package: String, new_owner_username_or_email: String) -> Result<()> {
76 let should_transfer_ownership = cli::confirm(&format!(
87 "Transferring ownership of this package will remove all current owners
98and make {new_owner_username_or_email} its new owner.
1010-Do you wish to transfer ownership of `{}` to {new_owner_username_or_email}?",
1111- config.name
99+Do you wish to transfer ownership of `{package}` to {new_owner_username_or_email}?",
1210 ))?;
13111412 if !should_transfer_ownership {
···2523 cli::print_transferring_ownership();
2624 runtime.block_on(hex::transfer_owner(
2725 &api_key,
2828- &config.name,
2626+ package,
2927 new_owner_username_or_email,
3028 &hex_config,
3129 &HttpClient::new(),