feat: creates support for swaps on the storefront (#355)
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
const path = require("path");
|
||||
const { spawn } = require("child_process");
|
||||
const path = require("path")
|
||||
const { spawn } = require("child_process")
|
||||
|
||||
const { setPort } = require("./use-api");
|
||||
const { setPort } = require("./use-api")
|
||||
|
||||
module.exports = ({ cwd, verbose }) => {
|
||||
const serverPath = path.join(__dirname, "test-server.js");
|
||||
const serverPath = path.join(__dirname, "test-server.js")
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
const medusaProcess = spawn("node", [path.resolve(serverPath)], {
|
||||
@@ -18,15 +18,15 @@ module.exports = ({ cwd, verbose }) => {
|
||||
stdio: verbose
|
||||
? ["inherit", "inherit", "inherit", "ipc"]
|
||||
: ["ignore", "ignore", "ignore", "ipc"],
|
||||
});
|
||||
})
|
||||
|
||||
medusaProcess.on("uncaughtException", (err) => {
|
||||
medusaProcess.kill();
|
||||
});
|
||||
medusaProcess.kill()
|
||||
})
|
||||
|
||||
medusaProcess.on("message", (port) => {
|
||||
setPort(port);
|
||||
resolve(medusaProcess);
|
||||
});
|
||||
});
|
||||
};
|
||||
setPort(port)
|
||||
resolve(medusaProcess)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user