Open sleeptightAnsiC opened 3 months ago
~Blocked by https://github.com/adamrehn/ue4cli/pull/63 - This PR must be merged/rejected before attempting the fix, as it touches the same code and also uses len(args) > 0
condition in few places.~
I was wrong...
Before passing args to the command, first arg is being already stripped here:
https://github.com/adamrehn/ue4cli/blob/fed71c1af4cffe3fed9358b08430068ad9454b77/ue4cli/cli.py#L216-L218
I just randomly found a logical error for ue4 build-target
Editing the issue
Running
ue4 build-target
without giving any argument causes a crash:~This is happening because some commands detect arguments with following condition:
len(args) > 0
Said condition will always evaluate toTrue
because Python always takes script directory as the first argument. We can easily changelen(args) > 0
tolen(args) > 1
and this should be resolved for most cases. However, when I was testing it, seems like not every function related to this issue would fail as I was expecting it, e.g.ue4 version
works just fine, so it's worth investigating what's going on under the hood before fixing it.~EDIT: No, I was wrong about it. The problem is super simple. We do
args.pop(0)
without checking ifargs
contains anything which is clearly mentioned in callstack :DLeaving this one for myself, should be quick to fix.
Reference: https://github.com/adamrehn/ue4cli/blob/fed71c1af4cffe3fed9358b08430068ad9454b77/ue4cli/cli.py#L52-L56