Skip to content

Commit

Permalink
Add bin/build and bin/upload
Browse files Browse the repository at this point in the history
  • Loading branch information
mooz committed Aug 14, 2019
1 parent 2302243 commit a8a2ff5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
8 changes: 5 additions & 3 deletions release.sh → bin/build
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#!/bin/bash

PROJ_ROOT=$(dirname $(realpath $0))/../
cd $PROJ_ROOT

npx prettier --tab-width 2 --write 'src/**/*.js'
npx webpack --mode=production

cd package
npx jsbox build
(cd package; npx jsbox build)

PKG_FILE="package/.output/ikeysnail.box"

if [ ! -e $PKG_FILE ]; then
if [[ -e $PKG_FILE ]]; then
echo "Finished creating the package."
echo "Run $ npm run release"
else
Expand Down
19 changes: 19 additions & 0 deletions bin/upload
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

PROJ_ROOT=$(dirname $(realpath $0))/../
cd $PROJ_ROOT

if [ $# -ne 1 ]; then
echo "Usage: upload HOSTNAME"
exit 1
fi

HOST=$1
PKG_FILE="package/.output/ikeysnail.box"

if [ -e $PKG_FILE ]; then
curl -X POST --form "files[]"=@$PKG_FILE http://${HOST}/upload
else
echo "No package found !"
exit 1
fi

0 comments on commit a8a2ff5

Please sign in to comment.