Skip to content

Commit

Permalink
fix: only copy non-output lines
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Oct 15, 2020
1 parent abd2666 commit 4ed4867
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/Terminal/Terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const Terminal = ({ children }) => {
<Button
variant={Button.VARIANT.LINK}
size={Button.SIZE.SMALL}
onClick={() => copy(children)}
onClick={() => copy(filterOutput(children))}
className="dark-mode"
css={css`
justify-self: end;
Expand Down Expand Up @@ -98,6 +98,13 @@ const Terminal = ({ children }) => {
);
};

const filterOutput = (commands) => {
return commands
.split('\n')
.filter((line) => !line.startsWith('[output]'))
.join('\n');
};

const FrameButton = ({ color }) => (
<div
css={css`
Expand Down

0 comments on commit 4ed4867

Please sign in to comment.