Skip to content

Commit

Permalink
Fix busted #git_add_remote_origin
Browse files Browse the repository at this point in the history
  • Loading branch information
azimux committed Mar 19, 2024
1 parent 3466e7f commit 5d44d63
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/write_empty_typescript_react_project_to_disk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,14 @@ def gh_repo_create
end

def git_add_remote_origin
git_remote_cmd = "git remote"
git_remote_add_cmd = "git remote add origin [email protected]:#{git_repo_path}.git"

Dir.chdir project_directory do
cmd = "git remote"
remotes = run_cmd_and_return_output(cmd)
remotes = run_cmd_and_return_output(git_remote_cmd)

if remotes !~ /^origin$/
cmd = "git remote add origin [email protected]:#{git_repo_path}.git"
run_cmd_and_write_output(cmd)
run_cmd_and_write_output(git_remote_add_cmd)
end
end
end
Expand Down

0 comments on commit 5d44d63

Please sign in to comment.