Right now the read_verilog command is passed all of the input verilog files as a list. The -sv option is added if any of the files in the list has the .sv extension. Instead, a read_verilog command should be issued for each file and the -sv option added based on that file's extension.