Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress UX courtesy reminders on non-interactive shells #804

Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions setup/pi/setup-teslausb
Original file line number Diff line number Diff line change
Expand Up @@ -918,11 +918,14 @@ sed -i '/source \/root\/bin\/setup-teslausb/d' /root/.bashrc
if ! grep -q TESLAUSB_TIP1 /root/.bashrc
then
cat >> /root/.bashrc <<- EOC
cat << TESLAUSB_TIP1
Run 'bin/setup-teslausb upgrade' to update to the latest version of teslausb,
or run 'bin/remountfs_rw' to allow writing to the root partition.

TESLAUSB_TIP1
if [ -n "\$PS1" ]
then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change this back to if [ ...] ; then, like it is below on line 938?
While the TeslaUSB scripts use the if-on-the-next-line style, this if is written to .bashrc, which uses the if-on-the-same-line style.

cat << TESLAUSB_TIP1
Run 'bin/setup-teslausb upgrade' to update to the latest version of teslausb,
or run 'bin/remountfs_rw' to allow writing to the root partition.

TESLAUSB_TIP1
fi
EOC
fi

Expand All @@ -932,10 +935,12 @@ then
if ! grep -q TESLAUSB_TIP1 "/home/$DEFUSER/.bashrc"
then
cat >> "/home/$DEFUSER/.bashrc" <<- EOC
cat << TESLAUSB_TIP1
Run 'sudo -i' if you need to make changes.
if [ -n "\$PS1" ]; then
cat << TESLAUSB_TIP1
Run 'sudo -i' if you need to make changes.

TESLAUSB_TIP1
TESLAUSB_TIP1
fi
EOC
fi
fi
Expand Down