-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from zuku/add-package-command
Add package command
- Loading branch information
Showing
3 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
font16seg | ||
|
||
font16seg is a sixteen-segment font implementation for M5Stack devices using MicroPython. | ||
|
||
|
||
How to use | ||
|
||
Copy font16seg.mpy file to the directory listed in sys.path. | ||
(Usually, same directory as your MicroPython file.) | ||
|
||
Write following code then execute. | ||
|
||
``` | ||
import font16seg | ||
|
||
font16seg.text(0, 0, "FONT16SEG") | ||
``` | ||
|
||
For more information, please visit the project page. | ||
https://github.com/zuku/font16seg |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/bash | ||
|
||
which zip > /dev/null 2>&1 | ||
if [ $? -ne 0 ]; then | ||
echo "zip command does not exist." >&2 | ||
exit 2 | ||
fi | ||
|
||
if [ ! -f "./dist/font16seg.py" ]; then | ||
echo "./dist/font16seg.py does not exist." >&2 | ||
echo "run build first" >&2 | ||
exit 3 | ||
fi | ||
if [ ! -f "./dist/font16seg.mpy" ]; then | ||
echo "./dist/font16seg.mpy does not exist." >&2 | ||
echo "run build first" >&2 | ||
exit 4 | ||
fi | ||
|
||
rm -f "./dist/package.zip" | ||
rm -rf "./dist/tmp" | ||
mkdir "./dist/tmp" | ||
|
||
echo "./dist/font16seg.mpy -> ./dist/tmp/font16seg.mpy" | ||
cp "./dist/font16seg.mpy" "./dist/tmp/" | ||
echo "./dist/font16seg.py -> ./dist/tmp/font16seg.py" | ||
cp "./dist/font16seg.py" "./dist/tmp/" | ||
echo "./LICENSE -> ./dist/tmp/LICENSE" | ||
cp "./LICENSE" "./dist/tmp/" | ||
echo "./readme.txt -> ./dist/tmp/readme.txt" | ||
cp "./readme.txt" "./dist/tmp/" | ||
echo | ||
echo "Create archive file" | ||
cd "./dist/tmp" | ||
zip "../package.zip" -r * | ||
cd "../../" | ||
rm -rf "./dist/tmp" | ||
|
||
echo | ||
if [ -f "./dist/package.zip" ]; then | ||
FILE_SIZE=`stat -c "%s" ./dist/package.zip` | ||
if [ $? -ne 0 ]; then | ||
echo "stat failed" >&2 | ||
exit 5 | ||
fi | ||
echo "Name: ./dist/package.zip" | ||
echo "Size: ${FILE_SIZE}" | ||
echo | ||
else | ||
echo "Failed" >&2 | ||
exit 6 | ||
fi | ||
|
||
exit 0 |