Open ymkNK opened 5 years ago
基于gitalk的留言功能搞定啦
task :git do
puts "请输入git内容 m"
@msg = STDIN.gets.chomp
@slug = "#{@msg}"
@slug = @slug.downcase.strip.gsub(' ', '-')
@date = Time.now.strftime("%F")
@finalmsg = "#{@date}-#{@slug}"
system "git add ."
system "git commit -m \"#{@finalmsg}\""
system "git push"
puts "git push \"#{@finalmsg}\" successfully"
end
添加上述代码到rakefile当中,可以实现快速的上传文章(其实就是省去了git 的一些操作指令)
http://blog.lllovol.com/rake/