nikivdev/code · error

GitHub URL is empty

Error message

GitHub URL is empty

What it means

Error "GitHub URL is empty" thrown in nikivdev/code.

Source

Thrown at src/publish.rs:22

use std::io::{self, IsTerminal, Write};
use std::path::{Path, PathBuf};
use std::process::Command;
use std::time::Duration;

use anyhow::{Context, Result, bail};
use crossterm::event::{self, Event as CEvent, KeyCode};
use crossterm::terminal::{disable_raw_mode, enable_raw_mode};
use reqwest::blocking::Client;
use serde::Serialize;

use crate::cli::{PublishAction, PublishCommand, PublishOpts};
use crate::config;
use crate::vcs;

fn parse_github_repo(url: &str) -> Result<(String, String, String)> {
    let trimmed = url.trim().trim_end_matches('/');
    if trimmed.is_empty() {
        bail!("GitHub URL is empty");
    }

    if let Some(rest) = trimmed.strip_prefix("git@github.com:") {
        let rest = rest.trim_end_matches(".git");
        let Some((owner, repo)) = rest.split_once('/') else {
            bail!("Invalid GitHub SSH URL: {}", url);
        };
        return Ok((
            owner.to_string(),
            repo.to_string(),
            format!("git@github.com:{}/{}.git", owner, repo),
        ));
    }

    if let Some(rest) = trimmed.strip_prefix("https://github.com/") {
        let rest = rest.trim_end_matches(".git");
        let Some((owner, repo)) = rest.split_once('/') else {
            bail!("Invalid GitHub HTTPS URL: {}", url);

View on GitHub (pinned to a747e741ae)

When it happens

Trigger: Thrown at src/publish.rs:22 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01). Data as JSON: /api/errors/d730e1207e28ebd5. Report an issue: GitHub.