Skip to content

Commit

Permalink
add install and installed scripts to help with setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Sherif Abushadi & Myles Byrne committed Aug 22, 2014
1 parent d9d844b commit 30d88d7
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
24 changes: 24 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh
set -e
dir=$(cd $(dirname $0); pwd)

# Make sure the DBC folder for links to executables is available
mkdir -p "$HOME/.dbc/bin"

# Create symbolic links to ruby-shim and process-run-data
ln -sf /usr/local/opt/student-activity-logger/ruby-shim $HOME/.dbc/bin/ruby
ln -sf /usr/local/opt/student-activity-logger/uploader/process-activity-data.sh $HOME/.dbc/bin/process-activity-data

# Add new PATH to .bash_profile so our ruby-shim is seen before the real ruby
cat >> ~/.bash_profile <<EOL
# Add ruby-shim to path
# see: https://github.com/devbootcamp/student-activity-logger
test -d \$HOME/.dbc/bin && PATH=\$HOME/.dbc/bin:\$PATH
EOL

# Install the plist file as a system daemon
sudo cp -rf $dir/com.devbootcamp.student-activity-logger.plist /Library/LaunchDaemons

# Load the plist file
sudo launchctl load /Library/LaunchDaemons/com.devbootcamp.student-activity-logger.plist
10 changes: 10 additions & 0 deletions installed.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Confirm the launchd plist file is installed
test -f /Library/LaunchDaemons/com.devbootcamp.student-activity-logger.plist

# Confirm the symbolic links have been setup for the shim and batch processor
test -L $HOME/.dbc/bin/ruby
test -L $HOME/.dbc/bin/process-activity-data

# Confirm that the path has been updated
# source ~/.bash_profile # reload .bash_profile first, then test? how is this done?
test "$HOME/.dbc/bin/ruby" = "$(which ruby)"

0 comments on commit 30d88d7

Please sign in to comment.