Skip to content

Commit

Permalink
default arch when building
Browse files Browse the repository at this point in the history
Updated to default to the correct architecture when building the
application. Allows for architecture to be overridden.
  • Loading branch information
Matt Hernandez committed Sep 3, 2015
1 parent b960255 commit 7179cbf
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
18 changes: 11 additions & 7 deletions lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ const Util = require('util');

const defaults = {
server: 'localhost',
directory: '.demeteorized',
architecture: 'os.linux.x86_64'
directory: '.demeteorized'
};

//
Expand All @@ -17,13 +16,18 @@ const defaults = {
//
module.exports = function (options, done) {
options = Hoek.applyToDefaults(defaults, options);

var build = ChildProcess.spawn('meteor', [
var args = [
'build',
'--server', options.server,
'--directory', Util.format('%s', options.directory),
'--architecture', options.architecture
], { cwd: options.input, stdio: 'inherit' });
'--directory', Util.format('%s', options.directory)
];

if (options.architecture) {
args.push('architecture');
args.push(options.architecture);
}

var build = ChildProcess.spawn('meteor', args, { cwd: options.input, stdio: 'inherit' });

build.on('error', function (err) {
done(err);
Expand Down
18 changes: 17 additions & 1 deletion test/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,29 @@ describe('build', function () {

it('defaults options', function (done) {
Build({}, function () {
expect(cpStub.spawn.calledWith('meteor', [
'build',
'--server',
'localhost',
'--directory',
'.demeteorized'
])).to.be.true();

done();
});

emitter.emit('close', 0);
});

it('overrides architecture when provided', function (done) {
Build({ architecture: 'os.linux.x86_64' }, function () {
expect(cpStub.spawn.calledWith('meteor', [
'build',
'--server',
'localhost',
'--directory',
'.demeteorized',
'--architecture',
'architecture',
'os.linux.x86_64'
])).to.be.true();

Expand Down

0 comments on commit 7179cbf

Please sign in to comment.