-
Notifications
You must be signed in to change notification settings - Fork 0
/
Thorfile
executable file
·43 lines (34 loc) · 1.21 KB
/
Thorfile
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 "thor/group"
module Middleman
class Generator < ::Thor::Group
include ::Thor::Actions
source_root File.expand_path(File.dirname(__FILE__))
def ask_stuff
@langs = ask("Please insert your site langs: (es. it,en)")
@token = ask("Please insert your DatoCMS site read-only token:")
@base_url = ask("What will be the base url of your site? (eg. https://www.mysite.com)")
@origin = ask("What is the origin remote? (eg. [email protected]:cantierecreativo/PROJECT.git)")
@production = ask("What is the production remote? (eg. [email protected]:cantierecreativo/PROJECT.git)")
end
def copy_default_files
directory "template", ".", exclude_pattern: /\.DS_Store$/
end
def copy_optional_files
template "optional/config.rb", "config.rb"
template "optional/env", ".env"
template "optional/README.md", "README.md"
run "yarn install"
end
def setup_remotes
run "git init"
if @origin != ""
run "git remote add origin #{@origin}"
end
if @production != ""
run "git remote add production #{@production}"
end
run "git add ."
run "git commit -m 'Boostrap project with template'"
end
end
end