summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFélix Sipma <felix.sipma@no-log.org>2017-09-25 11:34:03 +0200
committerFélix Sipma <felix.sipma@no-log.org>2017-09-25 11:34:03 +0200
commit6e9f14d4c2badd5d8b2154272f6906e4c3d95606 (patch)
treea615fbd2b0d891f5ae4f9f2de0a5a2adbf3e092e
parent2a1e14fd7b0ca68815a56037b6317ceaf650afa5 (diff)
use inproc instead of inshell in vcard_uid_generator.hs
-rwxr-xr-xvcard_uid_generator.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/vcard_uid_generator.hs b/vcard_uid_generator.hs
index 81a1e56..403e5f0 100755
--- a/vcard_uid_generator.hs
+++ b/vcard_uid_generator.hs
@@ -19,12 +19,12 @@ parser = argPath "src" "source directory containing the VCARD files"
main = sh $ do
src <- options "A simple in-place UID generator for VCARD files" parser
- let contacts = inshell ("rg UID --files-without-match " <> format fp src) empty
- file <- fromText . lineToText <$> contacts
+ contacts <- inproc "rg" ["UID", "--files-without-match", format fp src] empty
+ let file = fromText $ lineToText contacts
lines <- fold (input file) Fold.list
let (beginning, end) = splitAt 2 lines -- arbitrary split file between lines 2 and 3
valrand <- rand
let b = select (beginning ++ [valrand] ++ end)
output file b
where
- rand = inshell "cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 36 | head -n 1 | sed -e 's/^\\(.*\\)/UID:\\1\r/'" empty
+ rand = inshell "cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 36 | head -n 1 | sed -e 's/^\\(.*\\)/UID:\\1\\r/'" empty