Created
July 20, 2012 06:15
-
-
Save ratazzi/3149008 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Makefile for dict | |
# | |
# [email protected] | |
# | |
define zipheader | |
#!/bin/bash | |
PYTHON=$$(which python 2>/dev/null) | |
if [ ! -x "$${PYTHON}" ]; then | |
echo "Python executable not found" | |
exit 1 | |
fi | |
if [ -n "$${1}" ]; then | |
word="$${@}" | |
else | |
read word | |
fi | |
exec "$${PYTHON}" - "$${0}" "$$word" << END_OF_PYTHON_CODE | |
import sys | |
sys.path.insert(0, sys.argv[1]) | |
del sys.argv[0] | |
import dict | |
dict.main() | |
END_OF_PYTHON_CODE | |
# vim: ft=sh | |
endef | |
export zipheader | |
help: | |
@echo ' app generate one file app.' | |
@echo ' clean cleanup.' | |
app: | |
@echo "$$zipheader" > dict | |
zip - dict.py BeautifulSoup.py | cat - >> dict | |
chmod +x dict | |
clean: | |
rm -f dict |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment