diff options
Diffstat (limited to 'bin/import-statements')
-rwxr-xr-x | bin/import-statements | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/import-statements b/bin/import-statements new file mode 100755 index 0000000..12c8879 --- /dev/null +++ b/bin/import-statements @@ -0,0 +1,10 @@ +#! /bin/sh +# import-statements : lines (path ":" string) |> lines (path ":" relpath) +set -euf +sed -n ' + s@^\([^:]\+:\)\('"$(bre-invert-word import)"'\)*\<import\s\+@\1@ + t1;d + :1; s@^\([^:]\+:\)\(\.*/\S*\)@\1\2\n@ + t2;d + :2; P;D +' |