@@ -249,19 +249,26 @@ export async function processNodeManifest(
249
249
)
250
250
251
251
/**
252
- * Commas are considered special characters on Windows and are not valid in file paths with the exception of
253
- * the hard disk partition name at the beginning of a file path (i.e. C:).
252
+ * Windows has a handful of special/reserved characters that are not valid in a file path
253
+ * @reference https://superuser.com/questions/358855/what-characters-are-safe-in-cross-platform-file-names-for-linux-windows-and-os
254
+ *
255
+ * The one exception is the comma that is part of the hard disk partition name at the beginning of a file path (i.e. C:).
254
256
*
255
257
* During local development, node manifests can be written to disk but are generally unused as they are only used
256
- * for Content Sync which runs in Gatsby cloud . Gatsby cloud is a Linux environment in which colons are valid in
257
- * filepaths. To avoid errors on Windows, we replace all ":" instances in the filepath (with the exception of the
258
+ * for Content Sync which runs in Gatsby Cloud . Gatsby cloud is a Linux environment in which these special chars are valid in
259
+ * filepaths. To avoid errors on Windows, we replace all instances of the special chars in the filepath (with the exception of the
258
260
* hard disk partition name) with "-" to ensure that local Windows development setups do not break when attempting
259
261
* to write one of these manifests to disk.
260
262
*/
261
263
if ( process . platform === `win32` ) {
262
- manifestFilePath = manifestFilePath . replace ( / (?< ! ^ [ A - Z a - z ] ) : / g, `-` )
264
+ manifestFilePath = manifestFilePath . replace (
265
+ / ( (?< ! ^ [ A - Z a - z ] ) ) : | \/ | \* | \? | " | < | > | \| / g,
266
+ `-`
267
+ )
263
268
}
264
269
270
+ console . log ( `manifest file path: ${ manifestFilePath } ` )
271
+
265
272
const manifestFileDir = path . dirname ( manifestFilePath )
266
273
267
274
await fs . ensureDir ( manifestFileDir )
0 commit comments