Print new lock file contents during dry-run

This commit is contained in:
Carolyn Van Slyck 2017-03-15 10:06:07 -05:00
Родитель 2287888873
Коммит f5fbfe4921
1 изменённых файлов: 14 добавлений и 5 удалений

Просмотреть файл

@ -358,12 +358,21 @@ func (sw *SafeWriter) PrintPreparedActions() error {
}
if sw.Payload.HasLock() {
fmt.Println("Would have written the following changes to lock.json:")
diff, err := sw.Payload.LockDiff.Format()
if err != nil {
return errors.Wrap(err, "ensure DryRun cannot serialize the lock diff")
if sw.Payload.LockDiff == nil {
fmt.Println("Would have written the following lock.json:")
l, err := sw.Payload.Lock.MarshalJSON()
if err != nil {
return errors.Wrap(err, "ensure DryRun cannot serialize lock")
}
fmt.Println(string(l))
} else {
fmt.Println("Would have written the following changes to lock.json:")
diff, err := sw.Payload.LockDiff.Format()
if err != nil {
return errors.Wrap(err, "ensure DryRun cannot serialize the lock diff")
}
fmt.Println(diff)
}
fmt.Println(diff)
}
if sw.Payload.HasVendor() {