clean_output.sh 458 Bytes
Newer Older
Matthias Schiffer's avatar
Matthias Schiffer committed
1 2 3 4
#!/usr/bin/env bash

set -e

5
[ "$OPENWRT_TARGET" ] || exit 1
Matthias Schiffer's avatar
Matthias Schiffer committed
6 7 8 9 10


. scripts/common.inc.sh


11 12
if [ "$(expr match "$OPENWRT_TARGET" '.*-.*')" -gt 0 ]; then
	OPENWRT_BINDIR="${OPENWRT_TARGET//-/\/}"
Matthias Schiffer's avatar
Matthias Schiffer committed
13
else
14
	OPENWRT_BINDIR="${OPENWRT_TARGET}/generic"
Matthias Schiffer's avatar
Matthias Schiffer committed
15 16
fi

17
rm -f "openwrt/bin/targets/${OPENWRT_BINDIR}"/* 2>/dev/null || true
Matthias Schiffer's avatar
Matthias Schiffer committed
18 19

# Full builds will output the "packages" directory, so clean up first
20
[ "$DEVICES" ] || rm -rf "openwrt/bin/targets/${OPENWRT_BINDIR}/packages"