From 9a79de3659db658362143189c0ce5a15ef286f30 Mon Sep 17 00:00:00 2001 From: Kelvie Wong Date: Sun, 13 Sep 2020 14:32:28 -0700 Subject: [PATCH] export.fish: Remove source check This prevents starting a new shell with the IDF environment like this: env IDF_PATH=/my/idf/path fish -C 'source "$IDF_PATH"/export.fish' as `status current-command` returns `fish` in this case, but this check expects `source`. This check does nothing anyway, as you can't even execute that file even if it was marked executable, as fish rejects files without a shebang, and it's not valid bash. Closes https://github.com/espressif/esp-idf/pull/5860 --- export.fish | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/export.fish b/export.fish index 95c6b7d366..700f636487 100644 --- a/export.fish +++ b/export.fish @@ -1,15 +1,6 @@ # This script should be sourced, not executed. function idf_export_main - # The file doesn't have executable permissions, so this shouldn't really happen. - # Doing this in case someone tries to chmod +x it and execute... - set cmd (status current-command) - if test $cmd != source -a $cmd != . - echo "his script should be sourced, not executed:" - echo . (realpath (status --current-filename)/..) - return 1 - end - if not set -q IDF_PATH echo "IDF_PATH must be set before sourcing this script" return 1 @@ -72,4 +63,4 @@ end idf_export_main -set -e idf_export_main \ No newline at end of file +set -e idf_export_main