arch-ppa
arch-ppa copied to clipboard
Repository environment variable
Feature Request
I'm looking to link ~/arch-ppa/arch-ppa to my /usr/bin folder so that I can call it without needing to be in the git directory. Currently when running anything, it attempts to create all files in /usr/bin:
host@host1:~|⇒ arch-ppa list eyc
mkdir: cannot create directory ‘/usr/bin/src’: Permission denied
## Creating arch chroot ...
$ mkdir /usr/bin/chroot
mkdir: cannot create directory ‘/usr/bin/chroot’: File exists
Can you make sure it follows the symbolic link or uses a default repo directory?
Yea, I think it was just laziness on my part to have it run in place.
How about it creates a directory in $USER/.arch-ppa by default but could be changed by command flag (or perhaps env var like you suggested)?
I think default in $HOME/.arch-ppa is fine.
Really what would be cool is setting a command flag with arch-ppa setup -r $HOME/new/dir which would change the environment variable automatically.
I'll do this.
Cool, thanks
Real quick, I've never worked on a bash script like this... Typically I throw things into main() and call the functions from there.... How are you calling everything in here?
It's the $* bit on line 256.
It takes the exact command you typed in the cli and assumes the first word is the function name and the rest as arguments to that function.
Any reason we're using $* instead of $@? $@ should be used, from what I'm reading.
Also, I've read that it's bad practice to use $var when var is set inside the script. Are you okay if I change $var to ${var} when variables in the script are called?
I think you're right, specifically looks like we should use "$@" (with quotes):
http://stackoverflow.com/questions/12314451/accessing-bash-command-line-args-vs
Doesn't matter with the current args, but as we develop more it could become a problem.
I'll create another issue for it.
I admit I'm not sure what the problem is with $ vs ${}
From here:
Note that $variable is actually a simplified form of ${variable}. In contexts where the $variable syntax causes an error, the longer form may work
So it shouldn't matter, but it's better practice to use ${}.
works for me, thanks for the docs.
Sure thing, you okay if I put in more explicit help text? I enjoy documentation.
yes please
Covered by #6