From 7067e1649b3e1f37b8cd792936d01c66cd17c5b9 Mon Sep 17 00:00:00 2001 From: Em Zhan Date: Sat, 22 May 2021 15:05:10 -0400 Subject: [PATCH] Fix NetCDF conversion script for Windows 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: https://github.com/Unidata/netcdf-c/pull/1989 --- data/scripts/netcdf-to-fp16.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/scripts/netcdf-to-fp16.js b/data/scripts/netcdf-to-fp16.js index 078a79b5..10eadbd0 100755 --- a/data/scripts/netcdf-to-fp16.js +++ b/data/scripts/netcdf-to-fp16.js @@ -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];