Skip to content

Commit

Permalink
Require OSProcess dependency in FileSystemGitRepository>>commandExists:
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusDoe committed Nov 10, 2024
1 parent 52e1612 commit 575bb6a
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
git porcelain - external
commandExists: aString
^ (ShellSyntax new findExecutablePathFor: (aString copyUpTo: Character space) inDirectoryPath: nil) notNil
^ ((self osProcessClass: #ShellSyntax) new
findExecutablePathFor: (aString copyUpTo: Character space)
inDirectoryPath: nil) notNil
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
git porcelain - external
externalCommand: aString
| osProcess |
osProcess := (Smalltalk classNamed: #OSProcess) ifNil: [
(self confirm: 'OSProcess is not installed, but is needed to run git externally. Install it?') ifFalse: [^ self].
Installer ss project: 'OSProcess'; install: 'OSProcess'.
Installer ss project: 'CommandShell'; install: 'CommandShell'.
^ self externalCommand: aString].
osProcess := self osProcess.
UIManager default informUser: 'Running a git command in a terminal...' during: [
osProcess waitForCommand:
(osProcess isWindows
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
git porcelain - external
osProcess
^ self osProcessClass: #OSProcess
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
git porcelain - external
osProcessClass: aSymbol
(Smalltalk classNamed: aSymbol) ifNotNil: [:class | ^ class].
(self confirm: 'OSProcess is not installed, but is needed to run git externally. Install it?')
ifFalse: [^ self error: 'OSProcess is needed to run git externally.'].
Installer ss project: 'OSProcess'; install: 'OSProcess'.
Installer ss project: 'CommandShell'; install: 'CommandShell'.
^ Smalltalk classNamed: aSymbol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
git porcelain - external
suggestWSLGitInstallation
(OSProcess isWindows and: [self commandExists: 'wsl']) ifFalse: [^ ''].
(self osProcess isWindows and: [self commandExists: 'wsl']) ifFalse: [^ ''].
^ 'If git is installed in WSL, you can also enter ''wsl git''.'
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
"cloneExternalFrom:" : "mad 11/10/2024 16:45",
"cloneFrom:" : "mad 5/23/2024 18:12",
"cloneInternalFrom:" : "mad 5/23/2024 18:11",
"commandExists:" : "mad 4/3/2024 15:10",
"commandExists:" : "mad 11/10/2024 17:23",
"commitNamed:" : "jr 8/13/2020 23:08",
"createBranchNamed:at:" : "jr 3/4/2020 00:47",
"detectTerminalCommand" : "mad 10/31/2024 17:49",
"expandRemoteRef:" : "pre 6/15/2018 16:04",
"externalCommand:" : "mad 11/4/2024 12:53",
"externalCommand:" : "mad 11/10/2024 17:29",
"externalGitDo:" : "mad 11/10/2024 16:44",
"externalPush:toRemote:force:" : "mad 5/18/2024 12:26",
"fetchAllExternalFrom:" : "mad 5/23/2024 18:46",
Expand All @@ -32,6 +32,8 @@
"initializeOn:" : "MaxLeske 7/23/2010 09:59",
"knownTerminalCommands" : "mad 10/31/2024 17:31",
"orphanedHead" : "jr 1/29/2017 22:52",
"osProcess" : "mad 11/10/2024 17:29",
"osProcessClass:" : "mad 11/10/2024 17:24",
"performTerminalCommandTemplateReplacement:in:" : "mad 10/9/2024 15:07",
"pruneRefs:keep:" : "mad 4/7/2024 14:44",
"push:toRemote:" : "mad 5/18/2024 11:30",
Expand All @@ -48,7 +50,7 @@
"removeRemoteNamed:" : "jr 3/4/2020 00:49",
"repository" : "CamilloBruni 6/22/2011 05:08",
"requestTerminalCommand" : "mad 10/31/2024 17:50",
"suggestWSLGitInstallation" : "mad 11/10/2024 17:03",
"suggestWSLGitInstallation" : "mad 11/10/2024 17:29",
"tagNamed:" : "MCGitRepositoryTest 3/3/2020 23:40",
"tagNames" : "MCGitRepositoryTest 3/3/2020 23:42",
"tags" : "jr 3/4/2020 00:49",
Expand Down

0 comments on commit 575bb6a

Please sign in to comment.