Skip to content

install.sh does not work from alternate location #9

@rushtongarth

Description

@rushtongarth

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions