Ver Fonte

Fix build command for all OSes. (#161)

Fix build command for all OSes.
dmiric há 1 ano atrás
pai
commit
29c61e7e7b
1 ficheiros alterados com 3 adições e 2 exclusões
  1. 3 2
      build.mjs

+ 3 - 2
build.mjs

@@ -68,7 +68,8 @@ const copyToOut = async (file, config) => {
     console.log(`Copying ${file} to ${outputPath}`);
     return;
   }
-  await fs.mkdir(outputPath.replace(/\/[^/]+$/, ""), { recursive: true });
+  let dirNameRegex = new RegExp("\\" + path.sep + "([^\\" + path.sep + "]+)$");
+  await fs.mkdir(outputPath.replace(dirNameRegex, ""), { recursive: true });
   await fs.copyFile(file, outputPath);
 };
 
@@ -105,4 +106,4 @@ const medusaTransform = async (file) => {
 // Compile all files
 await Promise.all(files.map(async (file) => medusaTransform(file)));
 
-console.log(`Compiled all files in ${Date.now() - started}ms`);
+console.log(`Compiled all files in ${Date.now() - started}ms`);