From dd2b999e307e1c567e8449c21eed78b62d155a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrew=20Hong=20=28=ED=99=8D=EC=A4=80=EC=9B=90=29?= <35881688+novialriptide@users.noreply.github.com> Date: Fri, 10 Jun 2022 21:48:11 -0400 Subject: [PATCH 1/2] Add copy repo path --- app/src/ui/lib/context-menu.ts | 4 ++++ .../ui/repositories-list/repository-list-item.tsx | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/src/ui/lib/context-menu.ts b/app/src/ui/lib/context-menu.ts index 6f96ecb139d..8052c5804ea 100644 --- a/app/src/ui/lib/context-menu.ts +++ b/app/src/ui/lib/context-menu.ts @@ -13,6 +13,10 @@ export const CopySelectedRelativePathsLabel = __DARWIN__ ? 'Copy Relative Paths' : 'Copy relative paths' +export const CopyRepositoryLocationLabel = __DARWIN__ + ? 'Copy Repository Path' + : 'Copy repository path' + export const DefaultEditorLabel = __DARWIN__ ? 'Open in External Editor' : 'Open in external editor' diff --git a/app/src/ui/repositories-list/repository-list-item.tsx b/app/src/ui/repositories-list/repository-list-item.tsx index 34742ed8c76..d912b5769c2 100644 --- a/app/src/ui/repositories-list/repository-list-item.tsx +++ b/app/src/ui/repositories-list/repository-list-item.tsx @@ -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' }, { @@ -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<{ From b3492e271435566870e4c9bfbe76ce10c1275d76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrew=20Hong=20=28=ED=99=8D=EC=A4=80=EC=9B=90=29?= <35881688+novialriptide@users.noreply.github.com> Date: Mon, 13 Jun 2022 12:14:41 -0400 Subject: [PATCH 2/2] Remove CopyRepositoryLocationLabel --- app/src/ui/lib/context-menu.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/src/ui/lib/context-menu.ts b/app/src/ui/lib/context-menu.ts index 8052c5804ea..6f96ecb139d 100644 --- a/app/src/ui/lib/context-menu.ts +++ b/app/src/ui/lib/context-menu.ts @@ -13,10 +13,6 @@ export const CopySelectedRelativePathsLabel = __DARWIN__ ? 'Copy Relative Paths' : 'Copy relative paths' -export const CopyRepositoryLocationLabel = __DARWIN__ - ? 'Copy Repository Path' - : 'Copy repository path' - export const DefaultEditorLabel = __DARWIN__ ? 'Open in External Editor' : 'Open in external editor'