Skip to content

Commit

Permalink
[FAB-1476] Have Vagrant env cd to fabric dir
Browse files Browse the repository at this point in the history
https://jira.hyperledger.org/browse/FAB-1476

This changeset modifies `.bashrc` so that it cd's the user automatically
to `$GOPATH/src/github.com/hyperledger/fabric` upon logging in.

Change-Id: I4c5722d8c3b4796de34385e837a6cf12f2af6e82
Signed-off-by: Kostas Christidis <kostas@christidis.io>
  • Loading branch information
kchristidis committed Dec 23, 2016
1 parent 384e294 commit 51abe0d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions devenv/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ sudo chown -R vagrant:vagrant $GOPATH
# Update limits.conf to increase nofiles for RocksDB
sudo cp /hyperledger/devenv/limits.conf /etc/security/limits.conf

# configure vagrant specific environment
# Configure vagrant specific environment
cat <<EOF >/etc/profile.d/vagrant-devenv.sh
# Expose the devenv/tools in the $PATH
export PATH=\$PATH:/hyperledger/devenv/tools:/hyperledger/build/bin
Expand All @@ -105,7 +105,11 @@ export CGO_LDFLAGS="-lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy"
EOF

# Set our shell prompt to something less ugly than the default from packer
echo "PS1=\"\u@hyperledger-devenv:v$BASEIMAGE_RELEASE-$DEVENV_REVISION:\w$ \"" >> /home/vagrant/.bashrc
# Also make it so that it cd's the user to the fabric dir upon logging in
cat <<EOF >> /home/vagrant/.bashrc
PS1="\u@hyperledger-devenv:v$BASEIMAGE_RELEASE-$DEVENV_REVISION:\w$ "
cd $GOPATH/src/github.com/hyperledger/fabric/
EOF

# finally, remove our warning so the user knows this was successful
rm /etc/motd

0 comments on commit 51abe0d

Please sign in to comment.