From 63d6a244462d050e119bde54a7063bae8a17e987 Mon Sep 17 00:00:00 2001 From: eric thul Date: Fri, 25 Dec 2015 18:41:33 -0500 Subject: Splitting PSC functionality into a separate plugin The loader creates shim modules that reference their corresponding PureScript module that is bundled by the PureScript webpack plugin, which invokes `psc` and `psc-bundle`. Resolves #31 and resolves #32 --- src/PursLoader/ChildProcess.js | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 src/PursLoader/ChildProcess.js (limited to 'src/PursLoader/ChildProcess.js') diff --git a/src/PursLoader/ChildProcess.js b/src/PursLoader/ChildProcess.js deleted file mode 100644 index d62aef6..0000000 --- a/src/PursLoader/ChildProcess.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict'; - -// module PursLoader.ChildProcess - -var child_process = require('child_process'); - -var chalk = require('chalk'); - -function spawnFn(command, args, errback, callback) { - return function(){ - var process = child_process.spawn(command, args); - - var stdout = new Buffer(0); - - var stderr = new Buffer(0); - - process.stdout.on('data', function(data){ - stdout = Buffer.concat([stdout, new Buffer(data)]); - }); - - process.stderr.on('data', function(data){ - stderr = Buffer.concat([stderr, new Buffer(data)]); - }); - - process.on('close', function(code){ - var output = stdout.toString('utf-8'); - - var error = stderr.toString('utf-8'); - - if (error.length > 0) { - console.error('\n' + chalk.red('*') + ' ' + error); - } - - if (code !== 0) errback(new Error('Process terminated with code ' + code))(); - else callback(output)(); - }); - }; -} - -exports.spawnFn = spawnFn; -- cgit v1.2.3