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

install.sh does not work from alternate location #9

Open
rushtongarth opened this issue Jun 29, 2017 · 0 comments
Open

install.sh does not work from alternate location #9

rushtongarth opened this issue Jun 29, 2017 · 0 comments

Comments

@rushtongarth
Copy link

When executing install.sh line 67 and line 69 assume the current directory is the same as the file todo.py resulting in a file not found error.

Proposed changes:

#!/bin/bash
INSTALL_DIR=$HOME/bin
ALIAS_FILE=$HOME/.bashrc
THIS_SCRIPT=$(readlink -f $0) # Added to get full path to install.sh
CODE_DIR=$(dirname $THIS_SCRIPT) # Added to get full dirname of install.sh
prog="[""$(basename $THIS_SCRIPT)""] "

and

echo $prog"Copying todo.py to $INSTALL_DIR/todo.py"
if [[ ! -f $INSTALL_DIR/todo.py ]] ; then
    # addition of full path via CODE_DIR variable
    cp ${CODE_DIR}/todo.py $INSTALL_DIR
else
    # addition of full path via CODE_DIR variable
    cp -u ${CODE_DIR}/todo.py $INSTALL_DIR
fi

Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant