Skip to content
This repository has been archived by the owner on Jan 23, 2019. It is now read-only.

/usr/local/bin #1

Open
JaxxArmstrong opened this issue Jul 20, 2018 · 3 comments
Open

/usr/local/bin #1

JaxxArmstrong opened this issue Jul 20, 2018 · 3 comments

Comments

@JaxxArmstrong
Copy link

JaxxArmstrong commented Jul 20, 2018

No need to copy the script anywhere. Especially if you have git clone'd the repo. Just do a symbolic link to the script in question to /usr/local/bin. That way you can just do a git pull to update and no extra step to re-copy the script again.

You can also create a tiny install-script that does the symbolic link for you.

#!/bin/bash
scriptDir=$(dirname $(readlink -f $0))
sudo ln -s $scriptDir/todo.sh /usr/local/bin/

Just my two cents.

Ps. From my own perspective I wouldn't mind if you didn't call the dir 'todo.sh', ie removed the .sh at the end. This is just a personal reflection.

@js-d-coder
Copy link
Owner

Thanks for your feedback.
I named the repo as todo.sh because I might rewrite this script into another language, for example, in Python and create another repo named todo.py, keeping existing one too. In this way I can learn to compare two languages and remove confusion between github repos that do the same task.
As for your idea of using symbolic link, it is brilliant and simple.

@js-d-coder
Copy link
Owner

You might want to put double quotes around $scriptDir to prevent splitting and wildcard expansion.

#!/bin/bash
scriptDir=$(dirname $(readlink -f $0))
sudo ln -s "$scriptDir/todo.sh" /usr/local/bin/

@JaxxArmstrong
Copy link
Author

You're quite right. It was just an example early in the morning with a half-empty whiskey bottle beside the mouse.

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

No branches or pull requests

2 participants