diff --git a/.gitignore b/.gitignore index dad1db6..26ce53f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ target node_modules dist result +*.tgz diff --git a/build.sh b/build.sh index 61d553e..579cc62 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -euo pipefail +set -x RUST_ALL_TARGETS=( "changeset" @@ -29,6 +30,16 @@ build_rust_targets() { done } +build_dist() { + local TARGETS=${@/$CMD} + + for target in $TARGETS; do + if [ -f $target/dist.sh ]; then + cd $target && ./dist.sh + fi + done +} + export CARGO=`which cargo` if [ -z "${TARGET-}" ]; then @@ -45,7 +56,9 @@ if [ "${CMD}" == "clean" ]; then fi for cmd in $CMD; do - if [ "${TARGET}" == "all" ]; then + if [ "${CMD}" == "dist" ]; then + build_dist $TARGET + elif [ "${TARGET}" == "all" ]; then build_rust_targets $cmd ${RUST_ALL_TARGETS[*]} else build_rust_targets $cmd $TARGET diff --git a/dashboard/dashboard.desktop b/dashboard/dashboard.desktop new file mode 100644 index 0000000..70ac75b --- /dev/null +++ b/dashboard/dashboard.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Type=Application +Version=1.0 +Name=dashboard +Comment=My personal system dashboard +Exec=dashboard diff --git a/dashboard/dist.sh b/dashboard/dist.sh new file mode 100755 index 0000000..5de8bd4 --- /dev/null +++ b/dashboard/dist.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -euo pipefail +set -x + +mkdir -p dist +cp dashboard.desktop dist +cp ../target/release/dashboard dist +strip dist/dashboard +tar -cf dashboard.tgz dist/ +