Skip to content

Commit

Permalink
io.launcher: Add process-lines word.
Browse files Browse the repository at this point in the history
  • Loading branch information
erg committed Jul 17, 2018
1 parent 39cbe60 commit 279acbc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 3 additions & 0 deletions basis/io/launcher/launcher.factor
Expand Up @@ -236,6 +236,9 @@ PRIVATE>
: with-process-reader ( desc encoding quot -- )
with-process-reader* check-success ; inline

: process-lines ( desc -- lines )
utf8 <process-reader> stream-lines ;

<PRIVATE

: (process-writer) ( desc encoding -- stream process )
Expand Down
2 changes: 1 addition & 1 deletion basis/io/launcher/windows/windows-tests.factor
Expand Up @@ -144,7 +144,7 @@ SYMBOLS: out-path err-path ;
console-vm-path "-script" "stderr.factor" 3array >>command
[ "err2" ".txt" unique-file ] with-temp-directory
[ err-path set-global ] keep >>stderr
utf8 <process-reader> stream-lines first
process-lines first
] with-directory
] unit-test

Expand Down
5 changes: 1 addition & 4 deletions extra/cli/git/git.factor
Expand Up @@ -12,9 +12,6 @@ cli-git-num-parallel [ cpus 2 * ] initialize
: git-command>string ( quot -- string )
utf8 <process-reader> stream-contents [ blank? ] trim-tail ;

: git-command>lines ( quot -- string )
utf8 <process-reader> stream-lines ;

: git-clone-as ( uri path -- process ) [ { "git" "clone" } ] 2dip 2array append run-process ;
: git-clone ( uri -- process ) [ { "git" "clone" } ] dip suffix run-process ;
: git-pull* ( -- process ) { "git" "pull" } run-process ;
Expand All @@ -36,7 +33,7 @@ cli-git-num-parallel [ cpus 2 * ] initialize
: git-rev-parse* ( branch -- string ) [ { "git" "rev-parse" } ] dip suffix git-command>string ;
: git-rev-parse ( path branch -- string ) '[ _ git-rev-parse* ] with-directory ;
: git-diff-name-only* ( from to -- lines )
[ { "git" "diff" "--name-only" } ] 2dip 2array append git-command>lines ;
[ { "git" "diff" "--name-only" } ] 2dip 2array append process-lines ;
: git-diff-name-only ( path from to -- lines )
'[ _ _ git-diff-name-only* ] with-directory ;

Expand Down

0 comments on commit 279acbc

Please sign in to comment.