(specPath, repoRoot string)
| 983 | } |
| 984 | |
| 985 | func specRefForPrompt(specPath, repoRoot string) string { |
| 986 | if repoRoot == "" { |
| 987 | return specPath |
| 988 | } |
| 989 | rel, err := filepath.Rel(repoRoot, specPath) |
| 990 | if err != nil { |
| 991 | return specPath |
| 992 | } |
| 993 | if strings.HasPrefix(rel, "..") { |
| 994 | return specPath |
| 995 | } |
| 996 | if rel == "." { |
| 997 | return specPath |
| 998 | } |
| 999 | return filepath.ToSlash(rel) |
| 1000 | } |
| 1001 | |
| 1002 | func parseTitle(content string) string { |
| 1003 | for _, line := range strings.Split(content, "\n") { |