File tree Expand file tree Collapse file tree
blueprints/ember-cli-head Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/*jshint node:true*/
2+ let fs = require ( 'fs' ) ;
3+ let path = require ( 'path' ) ;
4+ let chalk = require ( 'chalk' ) ;
5+
26module . exports = {
37 description : '' ,
4- normalizeEntityName : function ( ) { }
8+ normalizeEntityName : function ( ) { } ,
9+ afterInstall ( ) {
10+ let fullPath = path . join ( this . project . root , 'app/templates/application.hbs' ) ;
11+
12+ if ( fs . existsSync ( fullPath ) ) {
13+ let contents = fs . readFileSync ( fullPath , { encoding : 'utf-8' } ) ;
14+ let toWrite = `{{head-layout}}\n${ contents } ` ;
15+
16+ fs . writeFileSync ( fullPath , toWrite , { encoding : 'utf-8' } ) ;
17+ } else {
18+ let str = `You must add {{head-layout}} component to your topmost UI.
19+ This is usually your app/templates/application.hbs, but was not found on your system.
20+ Please see the README for more instructions https://github.com/ronco/ember-cli-head.`
21+
22+ this . ui . writeLine ( chalk . yellow ( str ) ) ;
23+ }
24+ }
525
626 // locals: function(options) {
727 // // Return custom template variables here.
You can’t perform that action at this time.
0 commit comments