Fix for "Don't write empty indexes"

Change-Id: I451dc98c394fa9b0ce6b2eed338782939743d5a8
The create action reads from stdin when file is -

Change-Id: I3df1dac202323d7cf8b7bf04dcdb6bc7eb85b94e