File tree 5 files changed +140
-88
lines changed
5 files changed +140
-88
lines changed Original file line number Diff line number Diff line change @@ -63,13 +63,14 @@ module.exports = Command.extend({
63
63
project : this . project
64
64
} ) ;
65
65
66
+ let indexHtmlPath = path . join ( options . cordovaOutputPath , 'index.html' ) ;
67
+
66
68
let lint = new LintIndex ( {
67
- source : 'www/index.html' ,
68
- project : this . project
69
+ source : indexHtmlPath
69
70
} ) ;
70
71
71
72
let addCordovaJS = new AddCordovaJS ( {
72
- source : path . join ( options . cordovaOutputPath , 'index.html' )
73
+ source : indexHtmlPath
73
74
} ) ;
74
75
75
76
let framework = requireFramework ( this . project ) ;
Original file line number Diff line number Diff line change 1
1
const Command = require ( './-command' ) ;
2
+ const cordovaPath = require ( '../targets/cordova/utils/get-path' ) ;
2
3
const Lint = require ( '../tasks/lint-index' ) ;
4
+ const path = require ( 'path' ) ;
3
5
4
6
module . exports = Command . extend ( {
5
7
name : 'lint-index' ,
@@ -16,8 +18,7 @@ module.exports = Command.extend({
16
18
this . _super . apply ( this , arguments ) ;
17
19
18
20
let lint = new Lint ( {
19
- source : options . source ,
20
- project : this . project
21
+ source : path . join ( cordovaPath ( this . project ) , options . source )
21
22
} ) ;
22
23
23
24
return lint . run ( ) ;
Original file line number Diff line number Diff line change 1
1
const Task = require ( './-task' ) ;
2
2
const HTMLParser = require ( 'htmlparser2' ) . Parser ;
3
3
const Promise = require ( 'rsvp' ) . Promise ;
4
- const path = require ( 'path' ) ;
5
4
const fsUtils = require ( '../utils/fs-utils' ) ;
6
- const cordovaPath = require ( '../targets/cordova/utils/get-path' ) ;
7
5
const logger = require ( '../utils/logger' ) ;
8
6
9
7
const ROOT_URL_PATTERN = / ^ \/ / ;
@@ -78,8 +76,7 @@ module.exports = Task.extend({
78
76
} ,
79
77
80
78
run ( ) {
81
- let projectPath = cordovaPath ( this . project ) ;
82
- let indexPath = path . join ( projectPath , this . source ) ;
79
+ let indexPath = this . source ;
83
80
84
81
logger . info ( 'corber : Linting ' + indexPath + '...\n' ) ;
85
82
Original file line number Diff line number Diff line change @@ -161,8 +161,21 @@ describe('Build Command', function() {
161
161
let build = setupBuild ( ) ;
162
162
return build . run ( baseOpts ) . then ( function ( ) {
163
163
td . verify ( new LintTask ( {
164
- source : 'www/index.html' ,
165
- project : mockProject . project
164
+ source : 'corber/cordova/www/index.html' ,
165
+ } ) ) ;
166
+ } ) ;
167
+ } ) ;
168
+
169
+ it ( 'supports custom output path with --cordova-output-path option' , function ( ) {
170
+ let build = setupBuild ( ) ;
171
+ baseOpts . cordovaOutputPath = 'foo' ;
172
+
173
+ return build . run ( baseOpts ) . then ( function ( ) {
174
+ td . verify ( new AddCordovaJS ( {
175
+ source : 'foo/index.html'
176
+ } ) ) ;
177
+ td . verify ( new LintTask ( {
178
+ source : 'foo/index.html'
166
179
} ) ) ;
167
180
} ) ;
168
181
} ) ;
You can’t perform that action at this time.
0 commit comments