From 0ed47530ee0ee101eb6bb43d84e415c76a6de207 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Tue, 19 Sep 2023 09:26:35 -0700 Subject: [PATCH] io.launcher: use process-contents in a few places --- extra/backticks/backticks.factor | 6 ++---- extra/git/git-tests.factor | 9 +++------ extra/shell/shell.factor | 3 +-- extra/zealot/factor/factor.factor | 2 +- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/extra/backticks/backticks.factor b/extra/backticks/backticks.factor index 9fe62b62e9..671e2b0d51 100644 --- a/extra/backticks/backticks.factor +++ b/extra/backticks/backticks.factor @@ -1,11 +1,9 @@ ! Copyright (C) 2015 John Benediktsson ! See https://factorcode.org/license.txt for BSD license -USING: fry io io.encodings.utf8 interpolate io.launcher -multiline sequences ; +USING: interpolate io.launcher multiline sequences ; IN: backticks SYNTAX: ` "`" parse-multiline-string '[ - _ interpolate>string - utf8 [ read-contents ] with-process-reader + _ interpolate>string process-contents ] append! ; diff --git a/extra/git/git-tests.factor b/extra/git/git-tests.factor index 89870378d7..a09ccf18f3 100644 --- a/extra/git/git-tests.factor +++ b/extra/git/git-tests.factor @@ -1,12 +1,9 @@ ! Copyright (C) 2015 Doug Coleman. ! See https://factorcode.org/license.txt for BSD license. -USING: accessors fry git io io.directories io.encodings.utf8 -io.launcher io.streams.string kernel sequences tools.test ; +USING: accessors git io io.directories io.launcher +io.streams.string kernel sequences tools.test ; IN: git.tests -: run-process-stdout ( process -- string ) - >process utf8 [ read-contents ] with-process-reader ; - : with-empty-test-git-repo ( quot -- ) '[ { "git" "init" } run-process drop @@ -36,7 +33,7 @@ IN: git.tests { } [ [ - { "git" "log" } run-process-stdout print + { "git" "log" } process-contents print ] with-zero-byte-file-repo ] unit-test diff --git a/extra/shell/shell.factor b/extra/shell/shell.factor index d4bb109966..5248938a0e 100644 --- a/extra/shell/shell.factor +++ b/extra/shell/shell.factor @@ -29,8 +29,7 @@ M: factor-expr expand expr>> eval>string ; DEFER: expansion M: back-quoted-expr expand - expr>> expr command>> expansion - utf8 [ read-contents ] with-process-reader + expr>> expr command>> expansion process-contents " \n" split harvest ; : expansion ( command -- command ) [ expand ] map flatten ; diff --git a/extra/zealot/factor/factor.factor b/extra/zealot/factor/factor.factor index 4c7ccb2b67..bd13fc93dc 100644 --- a/extra/zealot/factor/factor.factor +++ b/extra/zealot/factor/factor.factor @@ -206,7 +206,7 @@ M: windows factor-path "./factor.com" ; : check-new-factor ( path branch/checksum cmd -- out ) nip [ factor-path "-i=factor.image" ] dip "-e=%s" sprintf 3array "./test-bisect-log" zealot-test-command - '[ _ utf8 [ read-contents ] with-process-reader ] with-directory ; + '[ _ process-contents ] with-directory ; : build-new-factor ( branch/checksum -- ) checkout-new-factor bootstrap-new-factor test-new-factor ; -- 2.34.1