Skip to content

Commit

Permalink
Fix NetCDF conversion script for Windows
Browse files Browse the repository at this point in the history
A bug in `ncdump` causes backslashes to be removed from the path given
as a command line argument. This wasn't a problem when calling the
conversion script manually as long as paths were typed with forward
slashes, but causes issues when the conversion script is called from
another node script because `path.join` uses backslashes as the default
path separator on Windows. Specifically, this would cause the output
files to be zero bytes, as no data would be piped.

This will be fixed in the next version of netCDF:

Unidata/netcdf-c#1989
  • Loading branch information
zqianem committed May 22, 2021
1 parent 4018219 commit 7067e16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion data/scripts/netcdf-to-fp16.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if (process.argv.length != 2 + 3 && process.argv.length != 2 + 4) {
process.exit(1);
}

const inputFile = process.argv[2];
const inputFile = process.argv[2].replace(/\\/g, '/');
const outputFile = process.argv[3];
const variable = process.argv[4];
const factor = process.argv[5];
Expand Down

0 comments on commit 7067e16

Please sign in to comment.