unify 'ensure sketch found' with the method doing the finding

tmp/arduino-cli-pre-rebase
Jesse Vincent 4 years ago
parent c3a8f2c883
commit 96974b33d4
No known key found for this signature in database
GPG Key ID: CC228463465E40BC

@ -200,16 +200,12 @@ _find_sketch() {
fi fi
done done
SKETCH_NOT_FOUND=1 SKETCH_NOT_FOUND=1
}
_ensure_sketch_found() {
if [ -n "${SKETCH_NOT_FOUND}" ]; then if [ -n "${SKETCH_NOT_FOUND}" ]; then
echo "I couldn't find your sketch (.ino file)" >&2 echo "I couldn't find your sketch (.ino file)" >&2
exit 1 exit 1
fi fi
} }
_prompt_before_flashing() { _prompt_before_flashing() {
flashing_instructions=$(_arduino_prop 'build.flashing_instructions') flashing_instructions=$(_arduino_prop 'build.flashing_instructions')
: "${flashing_instructions:="If your keyboard needs you to do something to put it in flashing mode, do that now."}" : "${flashing_instructions:="If your keyboard needs you to do something to put it in flashing mode, do that now."}"
@ -327,7 +323,6 @@ cmd_clean() {
_set_up_environment() { _set_up_environment() {
_find_sketch _find_sketch
_ensure_sketch_found
_set_build_paths _set_build_paths
_set_executable_paths _set_executable_paths
} }

Loading…
Cancel
Save