gluon/scripts/clean_output.sh

21 lines
464 B
Bash
Raw Normal View History

2017-01-18 16:21:43 +00:00
#!/usr/bin/env bash
set -e
2018-07-10 20:57:40 +00:00
[ "$OPENWRT_TARGET" ] || exit 1
2017-01-18 16:21:43 +00:00
. scripts/common.inc.sh
2018-07-10 20:57:40 +00:00
if [ "$(expr match "$OPENWRT_TARGET" '.*-.*')" -gt 0 ]; then
OPENWRT_BINDIR="${OPENWRT_TARGET//-/\/}"
2017-01-18 16:21:43 +00:00
else
2018-07-10 20:57:40 +00:00
OPENWRT_BINDIR="${OPENWRT_TARGET}/generic"
2017-01-18 16:21:43 +00:00
fi
2018-07-10 20:57:40 +00:00
rm -f "openwrt/bin/targets/${OPENWRT_BINDIR}"/* 2>/dev/null || true
2017-01-18 16:21:43 +00:00
# Full builds will output the "packages" directory, so clean up first
[ "$GLUON_DEVICES" ] || rm -rf "openwrt/bin/targets/${OPENWRT_BINDIR}/packages"