Skip to content
Snippets Groups Projects
Commit b626c4e1 authored by Fredrik Hübinette (Hubbe)'s avatar Fredrik Hübinette (Hubbe)
Browse files

create directories as needed...

Rev: bin/install_module:1.2
parent e5dc1d69
No related branches found
No related tags found
No related merge requests found
...@@ -6,10 +6,13 @@ ...@@ -6,10 +6,13 @@
FROM="$1" FROM="$1"
TO="$2" TO="$2"
DIRS_TO_MAKE=
DIR="$TO" DIR="$TO"
while : while :
do do
DIR=`echo $DIR | sed -e 's@/[^/]*$@@'` DIR=`echo $DIR | sed -e 's@/[^/]*$@@'`
case "$DIR" in case "$DIR" in
*.pmod) *.pmod)
if [ -d "$DIR" ]; then if [ -d "$DIR" ]; then
...@@ -34,6 +37,8 @@ do ...@@ -34,6 +37,8 @@ do
break break
fi fi
#FIXME: Add sed expression to quote spaces, quotes etc. in $DIR
DIRS_TO_MAKE="$DIR $DIRS_TO_MAKE"
;; ;;
*) break ;; *) break ;;
esac esac
...@@ -42,6 +47,12 @@ done ...@@ -42,6 +47,12 @@ done
BASE=`echo $TO | sed -e 's/\.[^.]*$//'` BASE=`echo $TO | sed -e 's/\.[^.]*$//'`
if test "x$DIRS_TO_MAKE" != x; then
mkdir $DIRS_TO_MAKE
else
:
fi
if [ -d "$BASE.pmod" ]; then if [ -d "$BASE.pmod" ]; then
EXT=`echo $TO | sed -e 's@(\.[^.]$)@\1@/'` EXT=`echo $TO | sed -e 's@(\.[^.]$)@\1@/'`
TO="$BASE.pmod/module.$EXT" TO="$BASE.pmod/module.$EXT"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment