Skip to content

Commit

Permalink
Support pipes in scripts (fixes #221)
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Aug 30, 2023
1 parent 17cd42f commit b18c8d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion @types/bash-parser/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ declare module '@ericcornelissen/bash-parser' {
commandAST: AST;
};

export type Node = CompoundList | Command | LogicalExpression | If | For | Function_;
type Pipeline = {
type: 'Pipeline';
commands: Command[];
};

export type Node = CompoundList | Command | LogicalExpression | If | For | Function_ | Pipeline;

export type AST = {
type: 'Script';
Expand Down
2 changes: 2 additions & 0 deletions src/binaries/bash-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ export const getBinariesFromScript = (
return getBinariesFromNodes(node.do.commands);
case 'CompoundList':
return getBinariesFromNodes(node.commands);
case 'Pipeline':
return getBinariesFromNodes(node.commands);
default:
return [];
}
Expand Down

0 comments on commit b18c8d3

Please sign in to comment.