Skip to content

Commit

Permalink
pydata.sh: Prevent running the script with sudo.
Browse files Browse the repository at this point in the history
  • Loading branch information
donnemartin committed Jul 25, 2015
1 parent 24f00ee commit cbbc215
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions pydata.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#!/usr/bin/env bash

# ~/.pydata
# ~/pydata.sh

# Ask for the administrator password upfront
sudo -v

# Keep-alive: update existing `sudo` time stamp until the script has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Removed user's cached credentials
# This script might be run with .dots, which uses elevated privileges
sudo -K

echo "------------------------------"
echo "Setting up pip."
Expand All @@ -22,8 +20,8 @@ echo "------------------------------"
echo "Setting up virtual environments."

# Install virtual environments globally
sudo pip install virtualenv
sudo pip install virtualenvwrapper
pip install virtualenv
pip install virtualenvwrapper

echo "------------------------------"
echo "Source virtualenvwrapper from ~/.extra"
Expand Down

0 comments on commit cbbc215

Please sign in to comment.