esp-adf icon indicating copy to clipboard operation
esp-adf copied to clipboard

Missing `export.fish` (AUD-6559)

Open Rodrigodd opened this issue 5 months ago • 1 comments

Is your feature request related to a problem? Please describe.

I have a fish script that finds all export.fish and create a alias that source it for each version of IDF that it finds. I would hope I could also for esp-adf, but esp-adf is missing export.fish.

Describe the solution you'd like

It would be good if esp-adf is aligned with esp-idf and provides a install.fish and export.fish, in addition to the already existing install.{sh,bat,ps1} and export.{sh,bat,ps1}

Describe alternatives you've considered

I can still just use export.sh through replay.

Additional context

Rodrigodd avatar Jul 18 '25 14:07 Rodrigodd

This script may solve your problem.


if not set -q ADF_PATH
    set -l adf_path "."
    
    set -l script_path (status --current-filename)
    if test -n "$script_path"
        set adf_path (realpath (dirname "$script_path"))
    else if set -q ADF_PATH
        if test -f "/.dockerenv"
            echo "Using the ADF_PATH found in the environment as docker environment detected."
            set adf_path $ADF_PATH
        end
    end
    
    set -gx ADF_PATH $adf_path
end

if not set -q IDF_PATH
    set -gx IDF_PATH "$ADF_PATH/esp-idf"
end

echo "ADF_PATH: $ADF_PATH"
echo "IDF_PATH: $IDF_PATH"

source "$IDF_PATH/export.fish"
if not test $status -eq 0
    echo "Error: Failed to source IDF export.fish"
    return 1
end

if test -f "$ADF_PATH/tools/adf_install_patches.py"
    "$ESP_PYTHON" "$ADF_PATH/tools/adf_install_patches.py" apply-patch
else
    echo "Warning: adf_install_patches.py not found at $ADF_PATH/tools"
end

echo -e "\nThe following command can be executed now to view detailed usage:"
echo -e ""
echo -e "  idf.py --help"
echo -e "\nCompilation example (The commands highlighted in yellow below are optional: Configure the chip and project settings separately)"
echo -e ""
echo -e "  cd $ADF_PATH/examples/cli"
echo -e "  \033[33midf.py set-target esp32\033[0m"
echo -e "  \033[33midf.py menuconfig\033[0m"
echo -e "  idf.py build"
echo -e ""

LiuCodee avatar Jul 30 '25 06:07 LiuCodee