Skip to content

Commit

Permalink
prepend repo source with gh base url (#523)
Browse files Browse the repository at this point in the history
* prepend repo source with gh base url

* run cargo fmt
  • Loading branch information
FarazPatankar committed Jul 30, 2024
1 parent fd57307 commit 0c38f35
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/commands/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use crate::{consts::TICK_STRING, mutations::TemplateVolume, util::prompt::prompt

use super::*;

const GITHUB_BASE_URL: &str = "https://github.com/";

/// Provisions a template into your project
#[derive(Parser)]
pub struct Args {
Expand Down Expand Up @@ -159,7 +161,10 @@ pub async fn fetch_and_create(
.transpose()?,
template: match &s.source {
Some(DeserializedServiceSource::Image { image }) => image.clone(),
Some(DeserializedServiceSource::Repo { repo, .. }) => repo.clone(),
// The `repo` is in the `${owner}/${repo}` format so we need to add the prefix
Some(DeserializedServiceSource::Repo { repo, .. }) => {
format!("{}{}", GITHUB_BASE_URL, repo)
}
None => s.name.clone(),
},
variables: (!variables.is_empty()).then_some(variables),
Expand Down

0 comments on commit 0c38f35

Please sign in to comment.