我想转换这个 bash 脚本:
#!/bin/bash
if ! [ $# == 2 ]; then
echo Usage: update-module admin-password module-file
exit 1
fi
if ! [ -f $2 ]; then
echo Error: module file $2 does not exist
exit 1
fi
curl -c /tmp/cookie.txt -d uname=admin -d pw=${1} http://localhost:8080/openmrs/loginServlet
curl -b /tmp/cookie.txt -F action=upload -F update=true -F moduleFile=\@$2 http://localhost:8080/openmrs/admin/modules/module.list
rm -rf /tmp/cookie.txt > /dev/null 2>&1
放入可以放入 maven pom.xml 文件中的东西。
请注意,module-file 是一个 jar 文件(重命名为 .omod),理想情况下,admin-password 将在命令行上指定,类似于 maven archetype:create http://maven.apache.org/guides/mini的命令行参数/guide-creating-archetypes.html#Alternative_way_to_start_creating_your_Archetype
(理想情况下,主机名也应该在命令行上指定)。
谢谢
你的米莎