Giter VIP home page Giter VIP logo

Comments (7)

anukriti-chawla avatar anukriti-chawla commented on August 15, 2024

I have tried directory() function which is changing my directory however "git clone" when done through cmd gives me following output :

Cloning into 'gitrepo'...
remote: Counting objects: 92, done
remote: Finding sources: 100% (92/92)
remote: Getting sizes: 100% (76/76)
remote: Compressing objects: 98% (2370/2400)
remote: Total 92 (delta 14), reused 89 (delta 14)
Unpacking objects: 100% (92/92), done.
Checking connectivity... done.

But running the same "git clone" thorugh zt-exec return only the first line of output :
Cloning into 'gitrepo'...

from zt-exec.

shelajev avatar shelajev commented on August 15, 2024

hi @anukriti-chawla, can you please try:

String output = new ProcessExecutor().dir("D:/myfolder").command("git", "clone", "--depth", "1", url).readOutput(true).execute()
            .outputUTF8(); 

and provide the output and the log for the process running zt-exec?

from zt-exec.

anukriti-chawla avatar anukriti-chawla commented on August 15, 2024

Hi @shelajev I tried the above mentioned command, gives me only the first line as out put : "Cloning into 'gitrepo'..."

from zt-exec.

shelajev avatar shelajev commented on August 15, 2024

All other lines are actually the stderr, so if you redirect the error stream you should see it:

String output = new ProcessExecutor()
  .dir("D:/myfolder")
  .command("git", "clone", "--depth", "1", url)
  .redirectErrorStream(true)
  .readOutput(true)
  .execute()
  .outputUTF8(); 

Also, please verify that the repository actually gets cloned in the correct directory.

from zt-exec.

anukriti-chawla avatar anukriti-chawla commented on August 15, 2024

I tried .redirectErrorStream(true) , but only getting the first line as earlier. Yes the repository is getting clonned successfully.

from zt-exec.

reinra avatar reinra commented on August 15, 2024

.redirectErrorStream(true)
is the default anyways.
Maybe the git command depends on whether it's used via terminal or not.

from zt-exec.

ZhuBicen avatar ZhuBicen commented on August 15, 2024

For the latest version, the dir function has been renamed to "directory(File directory)"

from zt-exec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.