Skip to content

Commit

Permalink
Merge pull request desktop#14785 from novialriptide/add-copy-path
Browse files Browse the repository at this point in the history
Add copy repo path
  • Loading branch information
tidy-dev authored Jun 14, 2022
2 parents b21b88b + b3492e2 commit 6f56ec9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions app/src/ui/repositories-list/repository-list-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ export class RepositoryListItem extends React.Component<
...this.buildAliasMenuItems(),
{
label: __DARWIN__ ? 'Copy Repo Name' : 'Copy repo name',
action: this.copyToClipboard,
action: this.copyNameToClipboard,
},
{
label: __DARWIN__ ? 'Copy Repo Path' : 'Copy repo path',
action: this.copyPathToClipboard,
},
{ type: 'separator' },
{
Expand Down Expand Up @@ -258,9 +262,13 @@ export class RepositoryListItem extends React.Component<
}
}

private copyToClipboard = () => {
private copyNameToClipboard = () => {
clipboard.writeText(this.props.repository.name)
}

private copyPathToClipboard = () => {
clipboard.writeText(this.props.repository.path)
}
}

const renderRepoIndicators: React.FunctionComponent<{
Expand Down

0 comments on commit 6f56ec9

Please sign in to comment.