From 279acbc53e8195c970c9d3496cfcf5a5af4d7ab1 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 16 Jul 2018 21:02:11 -0500 Subject: [PATCH] io.launcher: Add process-lines word. --- basis/io/launcher/launcher.factor | 3 +++ basis/io/launcher/windows/windows-tests.factor | 2 +- extra/cli/git/git.factor | 5 +---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/basis/io/launcher/launcher.factor b/basis/io/launcher/launcher.factor index a56a97294a..f82929fd15 100644 --- a/basis/io/launcher/launcher.factor +++ b/basis/io/launcher/launcher.factor @@ -236,6 +236,9 @@ PRIVATE> : with-process-reader ( desc encoding quot -- ) with-process-reader* check-success ; inline +: process-lines ( desc -- lines ) + utf8 stream-lines ; + >command [ "err2" ".txt" unique-file ] with-temp-directory [ err-path set-global ] keep >>stderr - utf8 stream-lines first + process-lines first ] with-directory ] unit-test diff --git a/extra/cli/git/git.factor b/extra/cli/git/git.factor index 03c8cbeabb..f91ad6aa23 100644 --- a/extra/cli/git/git.factor +++ b/extra/cli/git/git.factor @@ -12,9 +12,6 @@ cli-git-num-parallel [ cpus 2 * ] initialize : git-command>string ( quot -- string ) utf8 stream-contents [ blank? ] trim-tail ; -: git-command>lines ( quot -- string ) - utf8 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 ; @@ -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 ;