-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only store custom terminal commands in preference
Storing automatically detected terminal commands causes problems when knownTerminalCommands is updated, because an old command may still be stored.
- Loading branch information
Showing
9 changed files
with
22 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/FileSystem-Git.package/FileSystemGitRepository.class/instance/requestTerminalCommand.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
git porcelain - external | ||
requestTerminalCommand | ||
| command | | ||
command := UIManager request: | ||
'No terminal emulator could be detected. ', | ||
'Please provide a command to spawn a terminal emulator. ', | ||
(Preferences pragmaPreferenceFor: GitFeatureFlags getter: #customTerminalCommandForExternalCommands) helpString. | ||
GitFeatureFlags customTerminalCommandForExternalCommands: command. | ||
^ command |
12 changes: 1 addition & 11 deletions
12
src/FileSystem-Git.package/FileSystemGitRepository.class/instance/terminalCommand.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,3 @@ | ||
git porcelain - external | ||
terminalCommand | ||
^ GitFeatureFlags terminalCommandForExternalCommands | ||
ifNotEmpty: [:command | | ||
(self commandExists: command) | ||
ifTrue: [command] | ||
ifFalse: [ | ||
GitFeatureFlags terminalCommandForExternalCommands: ''. | ||
self terminalCommand]] | ||
ifEmpty: [ | command | | ||
command := self detectTerminalCommand. | ||
GitFeatureFlags terminalCommandForExternalCommands: command. | ||
command] | ||
^ GitFeatureFlags customTerminalCommandForExternalCommands ifEmpty: [self detectTerminalCommand] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...stem-Git.package/GitFeatureFlags.class/class/customTerminalCommandForExternalCommands..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
customTerminalCommandForExternalCommands: aString | ||
CustomTerminalCommandForExternalCommands := aString |
4 changes: 2 additions & 2 deletions
4
...ass/terminalCommandForExternalCommands.st → ...stomTerminalCommandForExternalCommands.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
accessing | ||
terminalCommandForExternalCommands | ||
customTerminalCommandForExternalCommands | ||
<preference: 'Command for spawning a terminal to run external commands' categoryList: #('Git expert settings') description: 'It should contain a pair of curly braces {} where the external command should be inserted. The braces may optionally contain a comma-separated sequence of actions: 1. {quote} quotes the command with single quotes before inserting it, 2. {abc:def} replaces all occurences of abc with def, 3. {no-key} prevents the prompt "Press any key to continue..." from being added after the command. These may be combined, e. g. {quote,":\",quote,sh:zsh}. The actions are executed left-to-right. See FileSystemGitRepository>>knownTerminalCommands for examples.' type: #String> | ||
|
||
^ TerminalCommandForExternalCommands ifNil: [''] | ||
^ CustomTerminalCommandForExternalCommands ifNil: [''] |
3 changes: 0 additions & 3 deletions
3
...FileSystem-Git.package/GitFeatureFlags.class/class/terminalCommandForExternalCommands..st
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
src/FileSystem-Git.package/GitFeatureFlags.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters