Skip to content

Commit

Permalink
Expo sample
Browse files Browse the repository at this point in the history
  • Loading branch information
Yorty Ruiz Hernandez committed Jan 21, 2024
1 parent 2636a0b commit d5ffe1e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions expo-sample.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env node
const fs = require('fs');
const execSync = require('child_process').execSync;
const config = require('./app.json');

const BUILD_NUMBER_COMPONENT_ID = 'my-buildnumber-app-ios';
const VERSION_CODE_COMPONENT_ID = 'my-buildnumber-app-android';
const COMMIT_MESSAGE = process.argv[2] || 'new build number';

config.expo.ios.buildNumber=String(execSync(`curl -s https://buildnumbr.com/${BUILD_NUMBER_COMPONENT_ID}`));
config.expo.android.versionCode=Number(execSync(`curl -s https://buildnumbr.com/${VERSION_CODE_COMPONENT_ID}`));

fs.writeFileSync('app.json', JSON.stringify(config, null, 2));

execSync('git add app.json');
execSync(`git commit -m '${COMMIT_MESSAGE} -- buildNumber: ${config.expo.ios.buildNumber}, versionCode: ${config.expo.android.versionCode}'`);

0 comments on commit d5ffe1e

Please sign in to comment.