Skip to content

Commit 7179cbf

Browse files
author
Matt Hernandez
committed
default arch when building
Updated to default to the correct architecture when building the application. Allows for architecture to be overridden.
1 parent b960255 commit 7179cbf

File tree

2 files changed

+28
-8
lines changed

2 files changed

+28
-8
lines changed

lib/build.js

+11-7
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ const Util = require('util');
55

66
const defaults = {
77
server: 'localhost',
8-
directory: '.demeteorized',
9-
architecture: 'os.linux.x86_64'
8+
directory: '.demeteorized'
109
};
1110

1211
//
@@ -17,13 +16,18 @@ const defaults = {
1716
//
1817
module.exports = function (options, done) {
1918
options = Hoek.applyToDefaults(defaults, options);
20-
21-
var build = ChildProcess.spawn('meteor', [
19+
var args = [
2220
'build',
2321
'--server', options.server,
24-
'--directory', Util.format('%s', options.directory),
25-
'--architecture', options.architecture
26-
], { cwd: options.input, stdio: 'inherit' });
22+
'--directory', Util.format('%s', options.directory)
23+
];
24+
25+
if (options.architecture) {
26+
args.push('architecture');
27+
args.push(options.architecture);
28+
}
29+
30+
var build = ChildProcess.spawn('meteor', args, { cwd: options.input, stdio: 'inherit' });
2731

2832
build.on('error', function (err) {
2933
done(err);

test/build.js

+17-1
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,29 @@ describe('build', function () {
3434

3535
it('defaults options', function (done) {
3636
Build({}, function () {
37+
expect(cpStub.spawn.calledWith('meteor', [
38+
'build',
39+
'--server',
40+
'localhost',
41+
'--directory',
42+
'.demeteorized'
43+
])).to.be.true();
44+
45+
done();
46+
});
47+
48+
emitter.emit('close', 0);
49+
});
50+
51+
it('overrides architecture when provided', function (done) {
52+
Build({ architecture: 'os.linux.x86_64' }, function () {
3753
expect(cpStub.spawn.calledWith('meteor', [
3854
'build',
3955
'--server',
4056
'localhost',
4157
'--directory',
4258
'.demeteorized',
43-
'--architecture',
59+
'architecture',
4460
'os.linux.x86_64'
4561
])).to.be.true();
4662

0 commit comments

Comments
 (0)