I know this is an old post, but I just went through this. I used an alias to make the call to source the file instead of a script. For bash, it can be put in ~/.bashrc. You will need to source the file with the alias before it can be used.
alias mycommand='source path/to/script