Merge branch 'paths'
This commit is contained in:
commit
8301cbc14b
27
unix/install
27
unix/install
@ -35,22 +35,27 @@ if [[ ":$PATH:" == *":$bin:"* ]]
|
||||
export PATH="$bin:$PATH"
|
||||
fi
|
||||
|
||||
for rc in "$HOME/.profile" "$HOME/.bashrc" "$HOME/.bash_profile"
|
||||
do
|
||||
if [ -f "$rc" ]
|
||||
if [[ ":$PATH:" == *":$HOME/bin:"* ]]
|
||||
then
|
||||
echo "'$HOME/bin' is in '$PATH' -- skipping"
|
||||
else
|
||||
export PATH="$HOME/bin:$PATH"
|
||||
fi
|
||||
|
||||
for rc in ~/.bashrc ~/.bash_profile ~/.profile ~/.zshrc ~/.zprofile ~/.zshenv
|
||||
do
|
||||
if [[ -f "$rc" ]]
|
||||
then
|
||||
if grep -q "PATH=\"\$HOME/bin:\$PATH\"" "$rc"
|
||||
if ! grep -q "export PATH=.*[:=]$HOME/bin[:$]" "$rc"
|
||||
then
|
||||
echo "Path adjustment found in $rc."
|
||||
else
|
||||
echo "Path adjustment not found in $rc. Adding it."
|
||||
echo "\n" >> "$rc"
|
||||
echo "export PATH=\"\$HOME/bin:\$PATH\"" >> "$rc"
|
||||
# This actually fixes the stupid newline thing
|
||||
echo -e "\n"'export PATH="$HOME/bin:$PATH"' >> "$rc"
|
||||
fi
|
||||
else
|
||||
echo "No $rc is present. Skipping."
|
||||
touch "$rc"
|
||||
echo -e 'export PATH="$HOME/bin:$PATH"' >> "$rc"
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
cp -r zomp "$zomp_dir"
|
||||
cp unix/zx "$zomp_dir"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user