Skip to content

Commit f8b202b

Browse files
Blake EasleyBlake Easley
Blake Easley
authored and
Blake Easley
committed
Fix parsing of sourcing with quotes
when argumentNode.text == 'source "./issue206.sh"', argumentNode.namedChildren contains an element that is string_content with text=='"./issue206.sh"'
1 parent c34eb5e commit f8b202b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server/src/util/sourcing.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ function getSourcedPathInfoFromNode({
109109
}
110110

111111
if (argumentNode.type === 'string' || argumentNode.type === 'raw_string') {
112-
if (argumentNode.namedChildren.length === 0) {
112+
const children = argumentNode.namedChildren
113+
if (
114+
children.length === 0 ||
115+
(children.length === 1 && children[0].type === 'string_content')
116+
) {
113117
return {
114118
sourcedPath: argumentNode.text.slice(1, -1),
115119
}

0 commit comments

Comments
 (0)