File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,8 @@ var Base = module.exports = function Base(args, options) {
115115 this . log = this . env . adapter . log ;
116116
117117 // determine the app root
118+ this . contextRoot = this . env . cwd ;
119+
118120 var rootPath = findUp . sync ( '.yo-rc.json' , {
119121 cwd : this . env . cwd
120122 } ) ;
Original file line number Diff line number Diff line change @@ -53,7 +53,8 @@ describe('Base', function () {
5353 describe ( 'constructor' , function ( ) {
5454 it ( 'set the CWD where `.yo-rc.json` is found' , function ( ) {
5555 var projectDir = path . join ( __dirname , 'fixtures/dummy-project' ) ;
56- process . chdir ( path . join ( projectDir , 'subdir' ) ) ;
56+ var subdir = path . join ( projectDir , 'subdir' ) ;
57+ process . chdir ( subdir ) ;
5758 this . env . cwd = process . cwd ( ) ;
5859
5960 var dummy = new this . Dummy ( [ 'foo' ] , {
@@ -63,6 +64,7 @@ describe('Base', function () {
6364
6465 assert . equal ( process . cwd ( ) , projectDir ) ;
6566 assert . equal ( dummy . destinationPath ( ) , projectDir ) ;
67+ assert . equal ( dummy . contextRoot , subdir ) ;
6668 } ) ;
6769
6870 it ( 'use the environment options' , function ( ) {
You can’t perform that action at this time.
0 commit comments