Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
inferior-shell
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
qitab
inferior-shell
Commits
f4bcff14
Commit
f4bcff14
authored
13 years ago
by
Francois-Rene Rideau
Browse files
Options
Downloads
Patches
Plain Diff
Update wrt tweak in xcvb-driver's run-program/ API.
parent
7cb6ec3e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README
+1
-0
1 addition, 0 deletions
README
run.lisp
+17
-25
17 additions, 25 deletions
run.lisp
with
18 additions
and
25 deletions
README
+
1
−
0
View file @
f4bcff14
...
...
@@ -77,6 +77,7 @@ RUN CMD &KEY ON-ERROR TIME SHOW HOST OUTPUT
on which to run the command using ssh if
it's not an alias for localhost as recognized by CURRENT-HOST-NAME-P
(be sure to have passphraseless login using ssh-agent).
OUTPUT is one of
On Windows, RUN will not succeed for pipes, only for simple commands.
On Unix, simple commands on localhost are executed directly, but
remote commands and pipes are executed by spawning a shell.
...
...
This diff is collapsed.
Click to expand it.
run.lisp
+
17
−
25
View file @
f4bcff14
...
...
@@ -18,23 +18,6 @@
command
return-code
))
(
zerop
return-code
)))
(
defun
run-program/
(
command
&key
ignore-error-status
output
)
(
check-type
command
cons
)
(
funcall
(
ecase
output
((
nil
)
'run-program/for-side-effects
)
((
string
:string
)
'run-program/read-output-string
)
((
:lines
)
'run-program/read-output-lines
)
((
:interactive
)
'run-program/interactively
)
((
:form
)
'run-program/read-output-form
)
((
:forms
)
'run-program/read-output-forms
))
command
:ignore-error-status
ignore-error-status
))
(
defun
run-shell-command
(
command
&rest
keys
&key
ignore-error-status
output
)
(
declare
(
ignore
ignore-error-status
output
))
(
check-type
command
string
)
(
apply
'run-program/
(
list
"/bin/sh"
"-c"
command
)
keys
))
(
defun
on-host-spec
(
host
spec
)
(
if
(
current-host-name-p
host
)
spec
...
...
@@ -46,16 +29,18 @@
(
null
(
etypecase
spec
(
string
(
apply
'run-
shell-command
spec
keys
))
(
apply
'run-
program/
spec
keys
))
(
cons
(
apply
'run-process-spec
(
parse-process-spec
spec
)
keys
))
(
process-spec
(
let
((
rkeys
(
list
:ignore-error-status
ignore-error-status
:output
output
)))
(
if
(
and
(
typep
spec
'command-spec
)
(
null
(
command-redirections
spec
)))
(
apply
'run-program/
(
command-arguments
spec
)
rkeys
)
(
apply
'run-shell-command
(
print-process-spec
spec
)
rkeys
))))))
(
let
((
command
(
if
(
and
(
typep
spec
'command-spec
)
(
null
(
command-redirections
spec
)))
(
command-arguments
spec
)
(
print-process-spec
spec
))))
(
run-program/
command
:ignore-error-status
ignore-error-status
:output
output
)))))
(
string
(
apply
'run-process-spec
(
on-host-spec
host
spec
)
:host
nil
keys
))
(
function
...
...
@@ -83,7 +68,14 @@
"Like run/s, but strips the line ending off the result string;
very much like `cmd` or $(cmd) at the shell"
(
declare
(
ignore
on-error
time
show
host
))
(
stripln
(
apply
'run/s
cmd
keys
)))
(
apply
'run
cmd
:output
:string/stripped
keys
))
(
defun
slurp-stream-string/stripped
(
input-stream
)
(
stripln
(
slurp-stream-string
input-stream
)))
(
defmethod
slurp-input-stream
((
x
(
eql
:string/stripped
))
input-stream
&key
&allow-other-keys
)
(
slurp-stream-string/stripped
input-stream
))
(
defun
run/lines
(
cmd
&rest
keys
&key
on-error
time
show
host
)
"Like run/s, but return a list of lines rather than one string"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment