Skip to content

Commit

Permalink
Add AbstractFileReference>>#gtActionGitRepositoryFor:
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvc committed Oct 21, 2024
1 parent 98bbead commit f368568
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/GToolkit4Git/AbstractFileReference.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ AbstractFileReference >> filename [
^self basename
]

{ #category : #'*GToolkit4Git' }
AbstractFileReference >> gtActionGitRepositoryFor: anAction [
<gtAction>

(self exists and: [ self isDirectory and: [ (self / '.git') exists ] ])
ifFalse: [ ^ anAction noAction ].

^ anAction button
icon: BrGlamorousVectorIcons branching;
tooltip: 'Open git repository';
action: [ :element | element phlow spawnObject: (PureGitRepository on: self) ]
]

{ #category : #'*GToolkit4Git' }
AbstractFileReference >> name [
^self basename
Expand Down

0 comments on commit f368568

Please sign in to comment.