-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
43 lines (38 loc) · 1.15 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
require "highline"
require "json"
require_relative 'lib/record_helper'
task default: :init
desc "Create me.json"
task :init do
puts ""
puts "Setting up your me.json:"
puts ""
Record.current.gather_names.gather_accounts.save
end
desc "Show the remote name based on the github account in me.json"
task :remote do
if File.exist? "./data/me.json"
json = JSON.parse File.read("./data/me.json")
github = json["info"].find { |item| item["url"].start_with? "https://github.com/" } if json["info"]
puts github["value"] if github
end
end
namespace :update do
desc "Update names, job title, and portfolio URL in me.json"
task :names do
puts ""
puts "Updating your names in me.json. Current values are displayed in square brackets."
puts "* Leave blank to skip updating"
puts ""
Record.current.gather_names.save
end
desc "Update contact info in me.json"
task :info do
puts ""
puts "Updating social accounts in me.json. Current values are displayed in square brackets."
puts "* Leave blank to skip updating"
puts "* Input nil to remove the account"
puts ""
Record.current.gather_accounts.save
end
end