https://github.com/peteruhnak/pharo-shell-proxy
https://github.com/peteruhnak/pharo-shell-proxy
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/peteruhnak/pharo-shell-proxy
- Owner: peteruhnak
- License: mit
- Created: 2016-11-19T15:42:07.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-06T11:12:49.000Z (about 8 years ago)
- Last Synced: 2025-02-09T18:52:09.067Z (3 months ago)
- Language: Python
- Size: 16.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pharo Shell Socket Proxy
This is a small utility for Windows that can execute external (shell) commands, thus partially replacing ProcessWrapper.
It contains a small Python server that executes (shell) commands via python's subprocess.
Pharo communicates with the server through sockets, thus avoiding broken OSProcess/ProcessWrapper libraries.Created mainly to cooperate with git command, so not really tested (WorksForMe™), but it feels much, much faster than ProcessWrapper.
Server's execution is logged in case something will fuck up.
## Example
```st
shell := SocketShell new.
response := shell command: #('git' 'log' '-n' '2' '--oneline').
response exitCode. -> 0
response stderr. -> ''
response stdout. -> '373c1df Merge remote-tracking branch ''origin/master''
99e1033 Initial commit
'
```## Installation
If for whatever reason you want to try this abomination, you can install it in Pharo
```st
Metacello new
baseline: #SocketShell;
repository: 'github://peteruhnak/pharo-shell-proxy/repository';
load
```Upon the first use the system will ask you for the location of the directory containing the `proxy.py` (`port.txt` with port number of the server will be created there).
During installation `SocketShell class>>initialize` will override `MCFileTreeGitRepository class>>runProcessWrapperGitCommand:in:` to use `SocketShell` instead.
If you installed `GitFileTree` after `SocketShell`, then you need to manually reinitialize the `SocketShell` class.The Python server `proxy.py` has to be started separately (for painfully obvious reasons not from Pharo).
The server can also be stopped with `SocketShell class>>terminateServer` on by running the `stopProxy.py` script.