: 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 )
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
: 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 ;
: 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 ;