forked from FormidableLabs/appr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
executable file
·29 lines (27 loc) · 909 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env node
const spawn = require('./scripts/spawn');
const config = require('./scripts/config');
const log = require('./scripts/log');
const preDeploy = require('./scripts/pre-deploy');
const postDeploy = require('./scripts/post-deploy');
const localExp = './node_modules/exp/bin/exp.js';
log('Logging into Expo...');
spawn(localExp, ['login', '-u', config.expUsername, '-p', config.expPassword, '--non-interactive'], loginError => {
if (loginError) {
throw new Error('Failed to log into Expo');
} else {
log('Logged into Expo.');
log('Preparing project for publish...');
preDeploy();
}
log('Publishing project into Expo.');
spawn(localExp, ['publish'], publishError => {
if (publishError) {
throw new Error('Failed to publish package to Expo');
} else {
log('Published project.');
log('Notifying GitHub...');
postDeploy();
}
});
});