mark ensure_sketch_found and find_sketch as private

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

@ -180,7 +180,7 @@ _build_paths() {
_absolute_filename() { _absolute_filename() {
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")" echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
} }
find_sketch() { _find_sketch() {
SKETCH_DIR="${SKETCH:-$(_absolute_filename "$(pwd)")}" SKETCH_DIR="${SKETCH:-$(_absolute_filename "$(pwd)")}"
SKETCH_BASE_NAME=$(basename "${SKETCH_DIR}") SKETCH_BASE_NAME=$(basename "${SKETCH_DIR}")
SKETCH_FILE_NAME="${SKETCH_BASE_NAME}.ino" SKETCH_FILE_NAME="${SKETCH_BASE_NAME}.ino"
@ -199,7 +199,7 @@ find_sketch() {
SKETCH_NOT_FOUND=1 SKETCH_NOT_FOUND=1
} }
ensure_sketch_found() { _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
@ -225,8 +225,8 @@ prompt_before_flashing() {
flash() { flash() {
find_sketch _find_sketch
ensure_sketch_found _ensure_sketch_found
_build_paths _build_paths
@ -253,8 +253,8 @@ flash() {
hex_with_bootloader() { hex_with_bootloader() {
find_sketch _find_sketch
ensure_sketch_found _ensure_sketch_found
_build_paths _build_paths
: "${BOOTLOADER_PATH:=$(_arduino_prop 'runtime.platform.path')/bootloaders/$(_arduino_prop 'bootloader.file')}" : "${BOOTLOADER_PATH:=$(_arduino_prop 'runtime.platform.path')/bootloaders/$(_arduino_prop 'bootloader.file')}"
@ -274,8 +274,8 @@ hex_with_bootloader() {
} }
compile() { compile() {
find_sketch _find_sketch
ensure_sketch_found _ensure_sketch_found
_build_paths _build_paths
_set_executable_paths _set_executable_paths
@ -338,24 +338,24 @@ compile() {
} }
size_map() { size_map() {
find_sketch _find_sketch
ensure_sketch_found _ensure_sketch_found
_build_paths _build_paths
_set_executable_paths _set_executable_paths
"${AVR_NM}" --size-sort -C -r -l -t decimal "${ELF_FILE_PATH}" "${AVR_NM}" --size-sort -C -r -l -t decimal "${ELF_FILE_PATH}"
} }
disassemble() { disassemble() {
find_sketch _find_sketch
ensure_sketch_found _ensure_sketch_found
_build_paths _build_paths
_set_executable_paths _set_executable_paths
"${AVR_OBJDUMP}" -C -d "${ELF_FILE_PATH}" "${AVR_OBJDUMP}" -C -d "${ELF_FILE_PATH}"
} }
clean() { clean() {
find_sketch _find_sketch
ensure_sketch_found _ensure_sketch_found
_build_paths _build_paths
if [ -d "$OUTPUT_PATH" ]; then if [ -d "$OUTPUT_PATH" ]; then
rm -rf -- "${OUTPUT_PATH}" rm -rf -- "${OUTPUT_PATH}"

Loading…
Cancel
Save