aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbuild.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/build.sh b/build.sh
index 5fcfbdf..3247682 100755
--- a/build.sh
+++ b/build.sh
@@ -1,7 +1,11 @@
#!/bin/bash
-contents="$(cat slack/*.py main.py | grep -Ev '^from slack[. ]')"
+shopt -s extglob
+
+contents="$(cat slack/util.py slack/task.py slack/!(util|task).py main.py | \
+ awk -v RS='\\([^)]+\\)' '/from.*import/ {gsub(/[[:space:]]+/, "", RT)} {ORS=RT} 1' | \
+ grep -Ev '^from slack[. ]')"
echo "$contents" | grep '^from __future__' | sort -u > build/slack.py
echo "$contents" | grep -v '^from __future__' | grep -E '^(import|from)' | sort -u >> build/slack.py
-echo "$contents" | grep -Ev '^(import|from)' >> build/slack.py
+echo "$contents" | grep -Ev '^(import|from)' | sed 's/^\( \+\)\(import\|from\).*/\1pass/' >> build/slack.py