Make reset more specific

This commit is contained in:
2023-02-16 14:59:44 -05:00
parent 25c317c4d0
commit 128c141843

View File

@@ -572,7 +572,7 @@ fromSource() {
seed_file="$SOURCEDIR/.config" seed_file="$SOURCEDIR/.config"
debug "seed_file: $seed_file" debug "seed_file: $seed_file"
execute pushd "$SOURCEDIR" || return 1 pushd "$SOURCEDIR" || return 1
# Update package feed # Update package feed
./scripts/feeds update -a && ./scripts/feeds update -a &&
@@ -648,7 +648,7 @@ fromSource() {
debug "make ${make_opts[*]} -j$(nproc) world" debug "make ${make_opts[*]} -j$(nproc) world"
make "${make_opts[@]}" -j"$(nproc)" world make "${make_opts[@]}" -j"$(nproc)" world
execute popd || return 1 popd || return 1
# Provide symlinks to images in root of BINDIR (to match Image Builder) # Provide symlinks to images in root of BINDIR (to match Image Builder)
shopt -s nullglob shopt -s nullglob
@@ -758,11 +758,11 @@ main() {
declare -g GITDIR="$BUILDROOT/src/openwrt" declare -g GITDIR="$BUILDROOT/src/openwrt"
if (( RESET )); then if (( RESET )); then
if [[ -d $SOURCEDIR ]] && askOk "Remove $SOURCEDIR?"; then if (( FROM_SOURCE )); then
execute git worktree remove --force "$SOURCEDIR" [[ -d $SOURCEDIR ]] && askOk "Remove $SOURCEDIR?"
execute rm -rf "$SOURCEDIR" execute git worktree remove --force "$SOURCEDIR"
fi execute rm -rf "$SOURCEDIR"
if [[ -d $BUILDDIR ]] && askOk "Remove $BUILDDIR?"; then elif [[ -d $BUILDDIR ]] && askOk "Remove $BUILDDIR?"; then
execute rm -rf "$BUILDDIR" execute rm -rf "$BUILDDIR"
fi fi
fi fi