File tree 1 file changed +15
-8
lines changed
src/compiler/crystal/tools
1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -44,20 +44,27 @@ module Crystal
44
44
end
45
45
46
46
def self.fetch_author
47
- return " [your-name-here]" unless system(WHICH_GIT_COMMAND )
48
- ` git config --get user.name` .strip
47
+ if system(WHICH_GIT_COMMAND )
48
+ user_name = ` git config --get user.name` .strip
49
+ user_name = nil if user_name.empty?
50
+ end
51
+ user_name || " your-name-here"
49
52
end
50
53
51
54
def self.fetch_email
52
- return " [your-email-here]" unless system(WHICH_GIT_COMMAND )
53
- ` git config --get user.email` .strip
55
+ if system(WHICH_GIT_COMMAND )
56
+ user_email = ` git config --get user.email` .strip
57
+ user_email = nil if user_email.empty?
58
+ end
59
+ user_email || " your-email-here"
54
60
end
55
61
56
62
def self.fetch_github_name
57
- default = " [your-github-name]"
58
- return default unless system(WHICH_GIT_COMMAND )
59
- github_user = ` git config --get github.user` .strip
60
- github_user.empty? ? default : github_user
63
+ if system(WHICH_GIT_COMMAND )
64
+ github_user = ` git config --get github.user` .strip
65
+ github_user = nil if github_user.empty?
66
+ end
67
+ github_user || " your-github-user"
61
68
end
62
69
63
70
def self.fetch_name (opts, args)
You can’t perform that action at this time.
0 commit comments