I've tried several different ways to get this to run, all unsuccessfully!
Currently, I have a groovy script that tries to execute the Postgresql (9.2) 'createdb' command like this:
def createDbCmdLine = "-p 5433 --encoding=UTF8 --template=template0 myDatabaseName"
ant.exec(executable:'fullpath/bin/createdb') {
arg(line: "$createDbCmdLine")
env(key:"PGPASSWORD", value:"myPassword")
}
However, this just hangs forever. When I tried creating a string and executing:
["sh", "-c", theStringHere].execute()
the result was the same - hangs forever. In this case though, I printed the string. When I ran that on the command line (directly or via 'sh -c') it worked perfectly - after the command completes, I can enter postgresql via 'psql' do a \l and see the database created.
Anyone know what the problem is?