Unable to automate Travis from command line


#1

Hi, I’m trying to automate some travis/github stuff in Julia. I’m running into some problems.

When I try to run travis login from the command line it works just fine, but if I try to run from within julia, I run into problems.

julia> run(`travis login`)
ERROR: could not spawn `travis login`: no such file or directory (ENOENT)
 in _jl_spawn(::String, ::Array{String,1}, ::Ptr{Void}, ::Base.Process, ::RawFD, ::RawFD, ::RawFD) at .\process.jl:321
 in #414 at .\process.jl:478 [inlined]
 in setup_stdio(::Base.##414#415{Cmd,Ptr{Void},Base.Process}, ::Tuple{RawFD,RawFD,RawFD}) at .\process.jl:466
 in #spawn#413(::Nullable{Base.ProcessChain}, ::Function, ::Cmd, ::Tuple{RawFD,RawFD,RawFD}, ::Bool, ::Bool) at .\process.jl:477
 in run(::Cmd) at .\process.jl:591

#2

From your command line check where travis is installed:
$ which travis

Check if that folder appears on PATH env from julia

julia> ENV["PATH"]


#3

What is travis here, and how did you install it?


#4

Yes, the path, C:\Ruby22-x64\bin, is in both which travis and ENV["PATH"]

travis is the command line interface for travis. I got it with gem install travis, where gem is Ruby’s package manager.


#5

Might be windows related… Does it happen only with travis command line tool? Does julia> run(dir) work for you?


#6

Yes, julia> run(dir) works fine


#7

Try running it from a windows Cmd prompt first. Julia will behave mostly like that on Windows.


#8

:frowning: should I file an issue?


#9

travis is a ruby script.
Does this work for you?

julia> run(`ruby --version`)
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]

#10

Yes, it works just fine


#11

Have you tried:

run(`cmd /c travis login`)

#12

Worked like a charm! How did you figure that out?