Skip to content

Commit

Permalink
fix: get back enstore
Browse files Browse the repository at this point in the history
  • Loading branch information
3cp committed Jun 14, 2019
1 parent c5c688a commit cf32452
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
const http = require('http');
const path = require('path');
const fs = require('fs');
const enstore = require('enstore');
const xws = require('xhr-write-stream')();
const launch = require('./lib/launch');
const serveStatic = require('serve-static');
Expand Down Expand Up @@ -33,14 +34,17 @@ function runner (opts, input, output) {
process.exit(1);
}

var bundle = enstore();
input.pipe(bundle.createWriteStream());

var mockHandler = opts.mock && require(path.resolve('./', opts.mock));

var server = http.createServer(function (req, res) {
if (opts.input === 'javascript') {
if (/^\/bundle\.js/.test(req.url)) {
res.setHeader('content-type', 'application/javascript');
res.setHeader('cache-control', 'no-cache');
input.pipe(res);
bundle.createReadStream().pipe(res);
return;
}

Expand All @@ -60,7 +64,7 @@ function runner (opts, input, output) {
}
} else if (opts.input === 'html') {
if (req.url == '/') {
input.pipe(res);
bundle.createReadStream().pipe(res);
return;
}
}
Expand Down
1 change: 0 additions & 1 deletion lib/browsers/edge.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const startScriptPath = path
function killEdgeProcess() {
try {
execSync('taskkill /t /f /im MicrosoftEdge.exe');
console.debug('Killed Edge process');
} catch (err) {
console.error('Killing Edge process failed. ' + err);
}
Expand Down
1 change: 0 additions & 1 deletion lib/browsers/ie.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ function killExtraIEProcess(pid) {

try {
execSync(wmic);
console.debug('Killed extra IE process.');
} catch (err) {
console.error('Killing extra IE process failed. ' + err);
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "browser-do",
"version": "0.0.1",
"description": "Alternative implementation of browser-run and tape-run, with better Windows support and smaller footprint.",
"description": "Alternative implementation of browser-run and tape-run, with better Windows support.",
"main": "index.js",
"engines": {
"node": ">=8.9"
Expand Down Expand Up @@ -47,6 +47,7 @@
},
"dependencies": {
"electron": "^5.0.3",
"enstore": "^1.0.1",
"finalhandler": "^1.1.2",
"lodash.kebabcase": "^4.1.1",
"optimist": "^0.6.1",
Expand Down

0 comments on commit cf32452

Please sign in to comment.