Add --force option to crewai tool publish (#1383)

This commit adds an option to bypass Git remote validations when
publishing tools.
This commit is contained in:
Vini Brasil
2024-10-04 11:02:50 -03:00
committed by GitHub
parent 92e867010c
commit c3291b967b
3 changed files with 316 additions and 271 deletions

View File

@@ -59,8 +59,8 @@ class ToolCommand(BaseCommand, PlusAPIMixin):
finally:
os.chdir(old_directory)
def publish(self, is_public: bool):
if not git.Repository().is_synced():
def publish(self, is_public: bool, force: bool = False):
if not git.Repository().is_synced() and not force:
console.print(
"[bold red]Failed to publish tool.[/bold red]\n"
"Local changes need to be resolved before publishing. Please do the following:\n"