feat: add --remote flag to init command for adding origin remote

This commit is contained in:
Yar Kravtsov
2025-05-24 06:26:43 +03:00
parent 9e1f834131
commit f640d6d11e
5 changed files with 71 additions and 1 deletions

View File

@@ -56,6 +56,14 @@ func (l *Lnk) Init() error {
return nil
}
// AddRemote adds a remote to the repository
func (l *Lnk) AddRemote(name, url string) error {
if err := l.git.AddRemote(name, url); err != nil {
return fmt.Errorf("failed to add remote %s: %w", name, err)
}
return nil
}
// Add moves a file to the repository and creates a symlink
func (l *Lnk) Add(filePath string) error {
// Validate the file