Little enhancements to migrate.sh script
- convert from dos to unix - spool
This commit is contained in:
parent
484507369c
commit
a66a58a232
|
@ -5,18 +5,20 @@
|
||||||
# mode (the default mode -- this stips out all the "commit" statements)
|
# mode (the default mode -- this stips out all the "commit" statements)
|
||||||
# and a commit mode for deployment. You need to pipe the output of this
|
# and a commit mode for deployment. You need to pipe the output of this
|
||||||
# script into sqlplus, for example:
|
# script into sqlplus, for example:
|
||||||
# ./migrate.sh 313-314 commit | sqlplus compiere/compiere
|
# ./migrate.sh 313-314 commit | sqlplus adempiere/adempiere
|
||||||
|
|
||||||
# Contributed by Chris Farley - northernbrewer
|
# Contributed by Chris Farley - northernbrewer
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
echo "Usage: migrate DIRECTORY [commit]"
|
echo "Usage: $0 DIRECTORY [commit]"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
echo "SET SQLBLANKLINES ON;"
|
echo "SET SQLBLANKLINES ON"
|
||||||
echo "SET DEFINE OFF;"
|
echo "SET DEFINE OFF"
|
||||||
|
echo "SPOOL $1"
|
||||||
for file in `ls $1`; do
|
for file in `ls $1`; do
|
||||||
echo "SELECT '$file' AS Filename FROM dual;"
|
echo "SELECT '$file' AS Filename FROM dual;"
|
||||||
|
dos2unix $1/$file
|
||||||
cat $1/$file | sed 's/commit[ ]*;//I'
|
cat $1/$file | sed 's/commit[ ]*;//I'
|
||||||
echo
|
echo
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue