Skip to content
This repository was archived by the owner on Apr 2, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ 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], loginError => {
spawn(localExp, ['login', '-u', config.expUsername, '-p', config.expPassword, '--non-interactive'], loginError => {
if (loginError) {
throw new Error('Failed to log into Expo');
} else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"eslint-plugin-import": "^2.2.0"
},
"dependencies": {
"exp": "^36.0.0",
"exp": "^44.0.0",
"request": "^2.81.0"
}
}
20 changes: 19 additions & 1 deletion scripts/pre-deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,28 @@ const config = require('./config');

module.exports = function preDeploy() {
const pkg = utils.readPackageJSON();
const name = utils.getExpPublishName(pkg.name, config.githubSourceBranch);
const modified = Object.assign({}, pkg, {
name: utils.getExpPublishName(pkg.name, config.githubSourceBranch),
name,
privacy: 'unlisted'
});

utils.writePackageJSON(modified);

let app = utils.readAppJSON();
if (app.expo) {
app.expo = Object.assign({}, app.expo, {
name,
slug: name,
privacy: 'unlisted'
});
} else {
app = Object.assign({}, app, {
name,
slug: name,
privacy: 'unlisted'
});
}

utils.writeAppJSON(app);
};
12 changes: 11 additions & 1 deletion scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,18 @@ function writePackageJSON(content) {
fs.writeFileSync('./package.json', JSON.stringify(content, null, 2));
}

function readAppJSON() {
return JSON.parse(fs.readFileSync('./app.json'));
}

function writeAppJSON(content) {
fs.writeFileSync('./app.json', JSON.stringify(content, null, 2));
}

module.exports = {
getExpPublishName,
readPackageJSON,
writePackageJSON
writePackageJSON,
readAppJSON,
writeAppJSON
};