Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/cue: fail cue fmt if arg import path doesn't exist
CL https://cuelang.org/cl/1185292 fixed an error in which `cue fmt` would fail if any files had invalid imports. This was done by ignoring errors of type load.PackageError. This introduced a bug. When running `cue fmt ./non-existing`, the command will now succeed with status code 0 - despite the fact that the provided import path is invalid. To fix this we don't ignore `load.PackageError` if no additional files were found, because in this case the import path provided as an argument must have been invalid. Signed-off-by: Noam Dolovich <[email protected]> Change-Id: I87ef60960b61924bf4c9493e5c492caa907ab294 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194124 TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Daniel Martí <[email protected]>
- Loading branch information