29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
# File 'lib/foundation/cli/generator.rb', line 29
def new(name)
unless which("compass")
run("gem install compass", capture: true, verbose: false)
run("rbenv rehash", capture: true, verbose: false) if which("rbenv")
end
unless which("node") || which("npm")
say "Please install NodeJS. (psst, go here: http://nodejs.org) Aborting."
exit 1
end
unless which("bower")
say "Please install bower. (psst, run: sudo npm install -g bower) Aborting."
exit 1
end
if options[:libsass]
unless which("grunt")
say "Please install grunt-cli. (psst, run: sudo npm install -g grunt-cli) Aborting."
exit 1
end
repo = "https://github.com/zurb/foundation-libsass-template.git"
else
unless which("compass")
run("gem install compass", capture: true, verbose: false)
run("rbenv rehash", capture: true, verbose: false) if which("rbenv")
end
repo = "https://github.com/zurb/foundation-compass-template.git"
end
say "Creating ./#{name}"
empty_directory(name)
run "git clone #{repo} #{name}", capture: true, verbose: false
inside(name) do
say "Installing dependencies with bower..."
run "bower install", capture: true, verbose: false
create_file "scss/_settings.scss", File.read("#{destination_root}/bower_components/foundation/scss/foundation/_settings.scss")
run "git remote rm origin", capture: true, verbose: false
if options[:libsass]
run "npm install"
run "grunt build"
end
end
say "./#{name} was created"
end
|