Skip to content

Commit

Permalink
fix: change push command to init
Browse files Browse the repository at this point in the history
  • Loading branch information
colinlienard committed Nov 18, 2024
1 parent 6589ae2 commit 762fab7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ This will ask you the Linear git branch name of an issue, and the name of the pu

| Command | Description |
| --------------- | ---------------------------------------------------------------- |
| `push` | Create a new conventional commit, create a new branch, and push. |
| `init` | Create a new conventional commit, create a new branch, and push. |
| `commit`, `-c` | Create a new conventional commit. |
| `version`, `-v` | Display the current and the latest version. |
| `update`, `-up` | Update the binary to the latest version. |
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl Config {
Ok((commit_name, _type, name))
}

pub fn ask_push() -> Result<(String, String, String), InquireError> {
pub fn ask_init() -> Result<(String, String, String), InquireError> {
let (commit_name, _type, name) = Config::ask_commit()?;

let branch = &name.replace(' ', "-").replace('\'', "").to_lowercase();
Expand Down
8 changes: 4 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async fn main() -> Result<(), Box<dyn Error>> {

match arg {
"pr" => pr_command().await?,
"push" => push_command()?,
"init" => init_command()?,
"commit" | "-c" => commit_command()?,
"config" => config_command()?,
"version" | "-v" => version_command().await?,
Expand Down Expand Up @@ -74,8 +74,8 @@ async fn pr_command() -> Result<(), Box<dyn Error>> {
Ok(())
}

fn push_command() -> Result<(), Box<dyn Error>> {
let (commit_name, branch, gh_compare_url) = Config::ask_push()?;
fn init_command() -> Result<(), Box<dyn Error>> {
let (commit_name, branch, gh_compare_url) = Config::ask_init()?;

git::create_branch(&branch)?;
println!("{}", "✔ Branch created.".green());
Expand Down Expand Up @@ -160,7 +160,7 @@ fn help_command() {
println!(" 3. Push to the remote repository.");
println!(" 4. Create a new pull request.");
println!(" 5. Assign you the pull request.");
println!(" push Do the following:");
println!(" init Do the following:");
println!(" 1. Create a new branch.");
println!(" 2. Create a new commit.");
println!(" 3. Push to the remote repository.");
Expand Down

0 comments on commit 762fab7

Please sign in to comment.