From 11ce720f9f3e8cb32207d9ca08a7d56024680cd3 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 28 Aug 2015 18:36:32 +0800 Subject: [PATCH] add more README vars --- models/repo.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/models/repo.go b/models/repo.go index e56c6db98..99be71651 100644 --- a/models/repo.go +++ b/models/repo.go @@ -530,9 +530,15 @@ func prepareRepoCommit(repo *Repository, tmpDir, repoPath string, opts CreateRep return fmt.Errorf("getRepoInitFile[%s]: %v", opts.Readme, err) } + cloneLink, err := repo.CloneLink() + if err != nil { + return fmt.Errorf("CloneLink: %v", err) + } match := map[string]string{ - "Name": repo.Name, - "Description": repo.Description, + "Name": repo.Name, + "Description": repo.Description, + "CloneURL.SSH": cloneLink.SSH, + "CloneURL.HTTPS": cloneLink.HTTPS, } if err = ioutil.WriteFile(filepath.Join(tmpDir, "README.md"), []byte(com.Expand(string(data), match)), 0644); err != nil {