Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions src/components/SearchResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ const SearchResult = (props: SearchResultProps): JSX.Element => {
const bucketUrl = metadata.repositoryOfficial ? '' : `${metadata.repository}`;
const bucketCommandLine = `${bucketName} ${bucketUrl}`.trim();

const bucketCommand = `scoop bucket add ${bucketCommandLine}`;
const appCommand = `scoop install ${installBucketName ? bucketName + '/' : ''}${name}`;
const fullCommand = `${bucketCommand}\n${appCommand}`;

return (
<Card key={id} className="mb-2" ref={cardRef}>
<Card.Header>
Expand Down Expand Up @@ -196,13 +200,22 @@ const SearchResult = (props: SearchResultProps): JSX.Element => {
</Col>
<Col lg={6} className="mt-4 mt-lg-0">
<Row>
<CopyToClipboardComponent value={`scoop bucket add ${bucketCommandLine}`} id="bucket-command" />
</Row>
<Row className="mt-2">
<CopyToClipboardComponent
value={`scoop install ${installBucketName ? bucketName + '/' : ''}${name}`}
id="app-command"
/>
<Col className="pe-1">
<Row>
<CopyToClipboardComponent value={`${bucketCommand}`} id="bucket-command" />
</Row>
<Row className="mt-2">
<CopyToClipboardComponent value={`${appCommand}`} id="app-command" />
</Row>
</Col>
<Col xs="auto" className="copy-command-group ps-1 d-flex">
<CopyToClipboardButton
className="copy-command-button"
title="Copy all to clipboard"
variant="outline-secondary"
onClick={() => handleCopyToClipboard(`${fullCommand}`)}
/>
</Col>
</Row>
</Col>
</Row>
Expand Down