@epic-web/workshop-app 5.3.5 → 5.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1306,7 +1306,7 @@ async function userHasAccessToWorkshop({
1306
1306
  }
1307
1307
  const UserInfoSchema = z.object({
1308
1308
  id: z.string(),
1309
- name: z.string(),
1309
+ name: z.string().nullable(),
1310
1310
  email: z.string().email(),
1311
1311
  image: z.string().nullable(),
1312
1312
  discordProfile: z.object({
@@ -5364,13 +5364,11 @@ async function launchEditor(pathList, lineNumber = 1, colNumber = 1) {
5364
5364
  if (process.platform === "linux" && fileName.startsWith("/mnt/") && /Microsoft/i.test(os.release())) {
5365
5365
  fileName = path$1.relative("", fileName);
5366
5366
  }
5367
- if (process.platform === "win32" && !WINDOWS_FILE_NAME_WHITELIST.test(
5368
- // replacing characters we know are fine (because heck if I'm going to edit that regex above 🙃)
5369
- fileName.replace(/\+|\$|\[|\]/g, "").trim()
5370
- )) {
5367
+ const fileExists = fs.existsSync(fileName);
5368
+ if (!fileExists && process.platform === "win32" && !WINDOWS_FILE_NAME_WHITELIST.test(fileName)) {
5371
5369
  acc.errorsList.push(fileName);
5372
5370
  } else {
5373
- if (!fs.existsSync(fileName)) {
5371
+ if (!fileExists) {
5374
5372
  fsExtra.ensureDirSync(path$1.dirname(fileName));
5375
5373
  fsExtra.writeFileSync(fileName, "", "utf8");
5376
5374
  }
@@ -5387,7 +5385,7 @@ async function launchEditor(pathList, lineNumber = 1, colNumber = 1) {
5387
5385
  message = `Could not open ${readableName} in the editor.
5388
5386
 
5389
5387
  When running on Windows, file names are checked against a whitelist to protect against remote code execution attacks.
5390
- File names may consist only of alphanumeric characters (all languages), periods, dashes, slashes, and underscores.`;
5388
+ File names may consist only of alphanumeric characters (all languages), periods, dashes, slashes, and underscores. Maybe you have your files in a folder that includes a space in the pathname? Rename the folder to remove the space and try again.`;
5391
5389
  } else {
5392
5390
  message = "pathList must contain at least one valid file path";
5393
5391
  }