-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add install and installed scripts to help with setup
- Loading branch information
Sherif Abushadi & Myles Byrne
committed
Aug 22, 2014
1 parent
d9d844b
commit 30d88d7
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)" |