Skip to content

Commit

Permalink
export.fish: set IDF_PATH without changing current working directory
Browse files Browse the repository at this point in the history
  • Loading branch information
imcaizheng committed Aug 30, 2022
1 parent ae256e9 commit 84ec01c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions export.fish
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ function unset
end

function __main
set script_dir (dirname (readlink -m (status -f)))

if not set -q IDF_PATH
set -gx IDF_PATH (cd (dirname (status -f)); and pwd)
set -gx IDF_PATH $script_dir
echo "Setting IDF_PATH to '$IDF_PATH'"
end

set script_dir (cd (dirname (status -f)); and pwd)
if test "$script_dir" = "."
set script_dir $pwd
end
if test "$IDF_PATH" != "$script_dir"
# Change IDF_PATH is important when there are 2 ESP-IDF versions in different directories.
# Sourcing this script without change, would cause sourcing wrong export script.
Expand Down

0 comments on commit 84ec01c

Please sign in to comment.