summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/goify/default.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2017-05-09 23:17:30 +0200
committermakefu <github@syntax-fehler.de>2017-05-09 23:17:30 +0200
commitfb1fff243a100757391552f7caa691bd9fe36097 (patch)
tree48d87558a609b9f45d43a37aa27bb04293b32689 /krebs/5pkgs/goify/default.nix
parent991687f7428440356403b6c63d695397b33078a6 (diff)
parent689399546d38b6dc5a643cc2efad9c1d0ae76058 (diff)
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'krebs/5pkgs/goify/default.nix')
-rw-r--r--krebs/5pkgs/goify/default.nix15
1 files changed, 8 insertions, 7 deletions
diff --git a/krebs/5pkgs/goify/default.nix b/krebs/5pkgs/goify/default.nix
index e2849b5c7..9c44aaeeb 100644
--- a/krebs/5pkgs/goify/default.nix
+++ b/krebs/5pkgs/goify/default.nix
@@ -1,17 +1,18 @@
{ pkgs, ... }:
-pkgs.writeDashBin "goify" ''
+pkgs.writeBashBin "goify" ''
set -euf
GO_HOST=''${GO_HOST:-go}
while read line; do
- echo "$line" | sed -E 's|https?://\S*|\n&\n|g' | while read word; do
- if echo "$word" | grep -Eq ^https?:; then
- ${pkgs.curl}/bin/curl -Ss -F uri="$word" http://"$GO_HOST" | tr -d '\r'
+ echo "$line" | sed 's|https\?://\S*|\n&\n|g' | while read word; do
+ if echo "$word" | grep -q '^https\?:'; then
+ ${pkgs.curl}/bin/curl -Ss -F uri="$word" http://"$GO_HOST" \
+ | tr -d '\r'
else
- echo "$word";
- fi;
- done | sed '/^$/d' | tr '\n' ' '; echo;
+ echo "$word"
+ fi
+ done | grep . | tr '\n' ' '; echo
done
''