command git finished with non-zero exit value 128

后端 未结 1 651
没有蜡笔的小新
没有蜡笔的小新 2021-01-25 00:41

When I migrate Android project from Eclipse to Android Studio, use travis ci to build the project, it has the following errors.

FAILURE: Build failed with

相关标签:
1条回答
  • 2021-01-25 01:35

    I catch revision in revision property from git command output in the code (code universal for unix /first exec/ and windows /second exec/, command git must work from console)

    def os = System.getProperty("os.name").toLowerCase()
    def revision = new ByteArrayOutputStream()
    if (!os.contains("windows")) {
        exec {
            executable "/bin/sh"
            args "-c", "echo -n `git rev-list HEAD | wc -l | sed 's/^[ ^t]*//'`"
            standardOutput = revision;
        }
    } else {
        exec {
            executable "cmd"
            args "/c", "git rev-list HEAD | find /c /v \"\""
            standardOutput = revision;
        }
        revision = revision as String
        revision = revision.trim()
    };
    

    You can change code for you needed.

    0 讨论(0)
提交回复
热议问题