File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -109,9 +109,23 @@ function getSourcedPathInfoFromNode({
109
109
}
110
110
111
111
if ( argumentNode . type === 'string' || argumentNode . type === 'raw_string' ) {
112
+ const stringContents = argumentNode . text . slice ( 1 , - 1 )
112
113
if ( argumentNode . namedChildren . length === 0 ) {
113
114
return {
114
- sourcedPath : argumentNode . text . slice ( 1 , - 1 ) ,
115
+ sourcedPath : stringContents ,
116
+ }
117
+ } else if ( argumentNode . namedChildren . length === 1 ) {
118
+ const [ variableNode ] = argumentNode . namedChildren
119
+ if (
120
+ variableNode . type == 'simple_expansion' ||
121
+ variableNode . type == 'expansion'
122
+ ) {
123
+ const variableText = `${ variableNode . text } `
124
+ if ( stringContents . startsWith ( variableText + '/' ) ) {
125
+ return {
126
+ sourcedPath : '.' + stringContents . slice ( variableText . length ) ,
127
+ }
128
+ }
115
129
}
116
130
}
117
131
}
You can’t perform that action at this time.
0 commit comments