jesus fucvk fix4es
This commit is contained in:
+6
-6
@@ -16,16 +16,16 @@ fi
|
||||
# detect shell and act accordingly
|
||||
defShell=$(awk -F: -v user="$(whoami)" '$1 == user {print $NF}' /etc/passwd)
|
||||
if [[ "$defShell" =~ zsh$ ]]; then
|
||||
echo -e "\nSelected zsh shell automatically\n"
|
||||
echo -e "\tSelected zsh shell automatically"
|
||||
rcFile="$HOME/.zshrc"
|
||||
elif [[ "$defShell" =~ bash$ ]]; then
|
||||
echo -e "\nSelected bash shell automatically\n"
|
||||
echo -e "\tSelected bash shell automatically"
|
||||
rcFile="$HOME/.bashrc"
|
||||
elif [[ "$defShell" =~ sh$ ]]; then
|
||||
rcFile="" # no need for rcFile var when run as cron
|
||||
else
|
||||
echo "unsupported shell $defShell"
|
||||
exit
|
||||
echo "FAIL: Unsupported shell $defShell"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# unset any esp-idf/-tools envvars
|
||||
@@ -56,11 +56,11 @@ rm -f "$installDir/install.log" 2>/dev/null
|
||||
rm -f "$installDir/version-data.log" 2>/dev/null
|
||||
|
||||
# cleanup $rcFile
|
||||
echo -e "\tCleaning up "$rcFile"
|
||||
echo -e "\tCleaning up $rcFile"
|
||||
sed -i.bak '/# esp-idf-tools/d' "$rcFile" # with first one, maek a backup
|
||||
sed -i '/ESPIDFTOOLS_INSTALLDIR/d' "$rcFile"
|
||||
sed -i '/get-esp-tools/d' "$rcFile"
|
||||
sed -i '/run-esp-cmd/d' "$rcFile
|
||||
sed -i '/run-esp-cmd/d' "$rcFile"
|
||||
sed -i '/esp-install-monitor/d' "$rcFile"
|
||||
sed -i '/esp-install-logs/d' "$rcFile"
|
||||
## remove leading and trailing newlines in $rcFile in place
|
||||
|
||||
Reference in New Issue
Block a user