Permalink
Browse files

add a "load_smartcd" shim to simplify new installs

  • Loading branch information...
cxreg committed Aug 8, 2014
1 parent 373e063 commit 84e37d15c803bc85c891b2cc4e9f6e127b654832
Showing with 20 additions and 2 deletions.
  1. +1 −1 Makefile
  2. +1 −1 README.md
  3. +18 −0 load_smartcd
View
@@ -29,7 +29,7 @@ install:
@echo
@echo "If this is your first time installing smartcd, run the following commands:"
@echo
@echo " source ~/.smartcd/lib/core/smartcd"
@echo " source load_smartcd"
@echo " smartcd config"
@echo
@echo "See the README file for ideas about what you can do with it"
View
@@ -39,7 +39,7 @@ These are just a few examples of problems people are solving with smartcd.
the source, you can:
make install
source ~/.smartcd/lib/core/smartcd
source load_smartcd
smartcd config
However, if you would rather skip all that and simply have it install itself,
View
@@ -0,0 +1,18 @@
#!/bin/bash
if [[ $0 =~ load_smartcd ]]; then
echo "This cannot be run as a command, please run"
echo
echo " source load_smartcd"
exit 1
fi
# Just loading ~/.smartcd_config would be enough if it
# already exists, but for new installs it may not
if [[ -f $HOME/.smartcd/lib/core/smartcd ]]; then
# TODO: handle system-wide install?
source $HOME/.smartcd/lib/core/smartcd
[[ -f $HOME/.smartcd_config ]] && source $HOME/.smartcd_config
else
echo 'smartcd not installed yet! Run "make install" or follow the README instructions'
fi

0 comments on commit 84e37d1

Please sign in to comment.