Skip to content

Commit

Permalink
base template is now 'roots-base'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Escalante committed Mar 6, 2014
1 parent fdf7d17 commit 224291f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions lib/api/new.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exec = require('child_process').exec
nodefn = require 'when/node/function'
sprout = require 'sprout'
global_config = require '../global_config'
_ = require 'lodash'

class New extends EventEmitter

Expand All @@ -16,9 +17,9 @@ class New extends EventEmitter
@template = opts.template || global_config().get('default_template')
@options = opts.options

if sprout.list().length < 1
# TODO: make this 'roots-base'
sprout.add(name: 'base', url: @base_url)
# if sprout list doesn't contain roots-base
if not _.contains(sprout.list(), 'roots-base')
sprout.add(name: 'roots-base', url: @base_url)
.catch((err) => @emit('error', err))
.tap(=> @emit('template:base_added'))
.then(=> init.call(@))
Expand Down
2 changes: 1 addition & 1 deletion lib/api/template.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ exports.reset = (override) ->

remove_roots_config = (deferred) ->
tasks = []
tasks.push(sprout.remove(tpl)) for tpl in _.without(sprout.list(), 'base')
tasks.push(sprout.remove(tpl)) for tpl in _.without(sprout.list(), 'roots-base')

W.all(tasks)
.then(-> fs.unlinkSync(global_config().path))
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/new.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports.execute = (args) ->
if not name then return console.error 'missing project name'.red
proj_path = path.join((args._[2] || process.cwd()), name)
tpl_name = k for k of args when k != '_' && k != '$0'
tpl_name ?= 'base'
tpl_name ?= 'roots-base'

Roots.new(path: proj_path, template: tpl_name)
.on('template:created', ->
Expand Down
2 changes: 1 addition & 1 deletion lib/global_config.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ pkg = require '../package.json'
module.exports = ->
new (require 'configstore') "#{pkg.name}-v#{pkg.version.split('.')[0]}",
package_manager: 'bower'
default_template: 'base'
default_template: 'roots-base'
2 changes: 1 addition & 1 deletion test/new_test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe 'new', ->
if err then return done(err)
events.should.be.above(2)
rimraf.sync(p)
Roots.template.remove('base').done((-> done()), done)
Roots.template.remove('roots-base').done((-> done()), done)

Roots.new(
path: p
Expand Down

0 comments on commit 224291f

Please sign in to comment.