@@ -24,7 +24,7 @@ module.exports.init = function (grunt) {
24
24
* @return {Boolean }
25
25
*/
26
26
function exists ( path ) {
27
- return fs . existsSync ( path ) ;
27
+ return fs . existsSync ( __dirname + path ) ;
28
28
}
29
29
30
30
/**
@@ -65,7 +65,7 @@ module.exports.init = function (grunt) {
65
65
app . use ( function ( req , res , next ) {
66
66
var url = req . url ,
67
67
match = url . match ( / ^ \/ ( [ A - Z ] [ ^ \/ ] + ) _ ( \w + ) \/ ( .+ ) $ / ) ,
68
- app ,
68
+ vendor ,
69
69
module ,
70
70
path ,
71
71
getModuleUrl ,
@@ -80,7 +80,7 @@ module.exports.init = function (grunt) {
80
80
return [
81
81
'/app/design' ,
82
82
area ,
83
- app ,
83
+ vendor ,
84
84
theme
85
85
] . join ( '/' ) ;
86
86
}
@@ -97,7 +97,7 @@ module.exports.init = function (grunt) {
97
97
}
98
98
99
99
if ( match !== null ) {
100
- app = match [ 1 ] ;
100
+ vendor = match [ 1 ] ;
101
101
module = match [ 2 ] ;
102
102
path = match [ 3 ] ;
103
103
@@ -111,10 +111,10 @@ module.exports.init = function (grunt) {
111
111
getModuleUrl = function ( shared ) {
112
112
return [
113
113
'/app/code' ,
114
- app ,
114
+ vendor ,
115
115
module ,
116
116
'view' ,
117
- shared ? share : area ,
117
+ ! ! shared ? share : area ,
118
118
'web' ,
119
119
path
120
120
] . join ( '/' ) ;
@@ -128,13 +128,16 @@ module.exports.init = function (grunt) {
128
128
getThemeUrl = function ( ) {
129
129
return [
130
130
themeRoot ( ) ,
131
- app + '_' + module ,
131
+ vendor + '_' + module ,
132
132
'web' ,
133
133
path
134
134
] . join ( '/' ) ;
135
135
} ;
136
136
137
- url = exists ( url = getThemeUrl ( ) ) ? url : getModuleUrl ( true ) ;
137
+ url = exists ( url = getThemeUrl ( ) ) ?
138
+ url :
139
+ exists ( url = getModuleUrl ( ) ) ?
140
+ url : getModuleUrl ( true ) ;
138
141
139
142
} else if ( canModify ( url ) ) {
140
143
url = ( exists ( url = lib ( true ) ) ? url : lib ( ) ) + req . url ;
0 commit comments