Run multiple commands through Ant exec

后端 未结 1 977
予麋鹿
予麋鹿 2021-02-20 18:51

I want to do this through an Ant build script:

$ /bin/sh
$ cd /path/to/executable
$ ./executable.sh

This is what I tried but I think it only ex

相关标签:
1条回答
  • 2021-02-20 19:40

    Only the first arg after the -c is run by the shell, hence the behaviour you see. Just put the two commands into one arg, separated by a semicolon:

    <exec executable="/bin/sh" os="Mac OS X">
        <arg value="-c"/>
        <arg value="cd /path/to/executable; ./executable.sh"/>
    </exec>
    
    0 讨论(0)
提交回复
热议问题