Article 5EXD5 My script does not work properly, what is wrong?

My script does not work properly, what is wrong?

by
lancsuk
from LinuxQuestions.org on (#5EXD5)
Hiya,

I was stuggling to install Xmonad on Slackware current, to me the best way to install Xmonad on Slackware current I think is stack.

I wrote a small script to make it easier to install and it works almost perfect.

Code:#!/bin/bash
PRGNAM=xmonad
PRGNAM_HOME=$HOME/.$PRGNAM

LPATH=$HOME/.local/bin
CWD=$(pwd)

if [ ! -d $LPATH ]; then
mkdir -p $LPATH
echo 'export PATH=\$PATH:$LPATH >> $HOME/.bash_profile'
source $HOME/.bash_profile
fi

wget -qO- https://get.haskellstack.org/ | sh

stack setup

mkdir -p $PRGNAM_HOME
cd $PRGNAM_HOME

# from inside of $PRGNAM_HOME/
git clone "https://github.com/xmonad/xmonad" xmonad-git
git clone "https://github.com/xmonad/xmonad-contrib" xmonad-contrib-git
git clone "https://github.com/jaor/xmobar" xmobar-git

stack init

mv $PRGNAM_HOME/stack.yaml $PRGNAM_HOME/stack.yaml.orig
cp $CWD/stack.yaml $PRGNAM_HOME/stack.yaml || exit 1

# from inside of $PRGNAM_HOME
stack install

cp $CWD/build $PRGNAM_HOME/build || exit 1

chmod a+x $PRGNAM_HOME/build

cp $CWD/xmonad.hs $PRGNAM_HOME/ || exit 1
cp $CWD/xmobarrc ~/.xmobarrc || exit 1
cp $CWD/xinitrc.xmonad ~/.xinitrc || exit 1
cp -a $CWD/wallpaper ~/wallpaper || exit 1But the if then statement does not work properly in particular to source my .bash_profile file....

Code:if [ ! -d $LPATH ]; then
mkdir -p $LPATH
echo 'export PATH=\$PATH:$LPATH >> $HOME/.bash_profile'
source $HOME/.bash_profile
fi....to source my bash_profile manually works great, but I prefer a 100% automatically installation.

any suggestions?

thanks Franklatest?d=yIl2AUoC8zA latest?i=vmS8jEGP1Oo:nPDvMM2YsHY:F7zBnMy latest?i=vmS8jEGP1Oo:nPDvMM2YsHY:V_sGLiP latest?d=qj6IDK7rITs latest?i=vmS8jEGP1Oo:nPDvMM2YsHY:gIN9vFwvmS8jEGP1Oo
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments