8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/til/initializer.rb', line 8
def create_settings_file
notes_directory = ask("What directory do you want your TIL notes to live in? (If you have no preference, `~/til` is a good option.)\n>")
github_repo = ask("Do you have a GitHub repo for your TIL notes? If so, enter it in the form `kevinlitchfield/til`.\n>")
settings_hash = {
"directory" => notes_directory,
"github_repo" => github_repo
}
puts "Creating a settings file at `#{Settings.settings_file_path}`."
File.open(Settings.settings_file_path, "w") do |f|
f.write(settings_hash.to_json)
end
end
|