- add a -n option to dev to bootstrap a new project,
- allow using an already exported DEVROOT. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35071 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Vendored
+18
-6
@@ -17,10 +17,12 @@
|
|||||||
#
|
#
|
||||||
# This script should be sourced by bash, either from /etc/profile
|
# This script should be sourced by bash, either from /etc/profile
|
||||||
# (in /etc/profile.d/) or your own .bashrc or .profile
|
# (in /etc/profile.d/) or your own .bashrc or .profile
|
||||||
|
# after exporting DEVROOT optionally to point to the projects folder.
|
||||||
#
|
#
|
||||||
# setup:
|
# setup:
|
||||||
# - edit DRLIST below to include your own possible devroots
|
# - edit DRLIST below to include your own possible devroots
|
||||||
# (ie. where you have subfolders for your own projects)
|
# (ie. where you have subfolders for your own projects)
|
||||||
|
# or export DEVROOT before sourcing dev-perso.
|
||||||
# - optionally edit PWLIST below to where you possibly have a
|
# - optionally edit PWLIST below to where you possibly have a
|
||||||
# PASSWDS/ folder with passwords stored as plain text.
|
# PASSWDS/ folder with passwords stored as plain text.
|
||||||
# (not really a good idea though :) It's exported
|
# (not really a good idea though :) It's exported
|
||||||
@@ -51,15 +53,19 @@
|
|||||||
|
|
||||||
|
|
||||||
# automagically find them on different machines...
|
# automagically find them on different machines...
|
||||||
DRLIST="$HOME/devel /Data /work /Volumes/Data/devel"
|
if [ -z "$DEVROOT" ]; then
|
||||||
|
DRLIST="$HOME/devel /Data /work /Volumes/Data/devel"
|
||||||
|
for d in $DRLIST; do
|
||||||
|
test -d $d && DEVROOT=$d && break;
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
export DEVROOT
|
||||||
|
|
||||||
|
# automagically find password files
|
||||||
PWLIST="/Data /fat32 $HOME"
|
PWLIST="/Data /fat32 $HOME"
|
||||||
for d in $DRLIST; do
|
|
||||||
test -d $d && DEVROOT=$d && break;
|
|
||||||
done
|
|
||||||
for d in $PWLIST; do
|
for d in $PWLIST; do
|
||||||
test -d $d/PASSWDS && PASSWDS=$d/PASSWDS && break;
|
test -d $d/PASSWDS && PASSWDS=$d/PASSWDS && break;
|
||||||
done
|
done
|
||||||
export DEVROOT
|
|
||||||
export PASSWDS
|
export PASSWDS
|
||||||
|
|
||||||
# svn sometimes forgets about vi and wants me to use nano...
|
# svn sometimes forgets about vi and wants me to use nano...
|
||||||
@@ -73,10 +79,16 @@ function dev() {
|
|||||||
fi
|
fi
|
||||||
if [ "x$1" = "x--help" ]; then
|
if [ "x$1" = "x--help" ]; then
|
||||||
echo "setup project-specific development environment"
|
echo "setup project-specific development environment"
|
||||||
echo "usage: dev [project]"
|
echo "usage: dev [-n] [project]"
|
||||||
echo "running without argument lists available projects"
|
echo "running without argument lists available projects"
|
||||||
|
echo "-n projname initializes a new project"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
if [ "x$1" = "x-n" -a -n "$2" ]; then
|
||||||
|
shift
|
||||||
|
mkdir "$DEVROOT/$1" && touch "$DEVROOT/$1/.profile"
|
||||||
|
# fallback
|
||||||
|
fi
|
||||||
if [ ! -d "$DEVROOT/$1" ]; then
|
if [ ! -d "$DEVROOT/$1" ]; then
|
||||||
echo "invalid project name '$1'"
|
echo "invalid project name '$1'"
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
Reference in New Issue
Block a user