...
 
Commits (2)
......@@ -5,6 +5,7 @@
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"validate-locales": "node tasks/validate-locales.js",
"update-settings": "ts-node tasks/update-settings.js",
"test": "jest",
"locale": "ts-node tasks/poeditor.js",
"e2e": "jest -c jest.e2e.config.js",
......
import { createReadStream, writeFileSync } from 'fs';
import { join } from 'path';
const request = require('request');
const options = {
method: 'GET',
uri: 'https://www.minds.com/api/v1/minds/config'
};
/**
* Update the default values with the latests production values
*/
request(options, (error, response, body) => {
if (error) {
reject(error);
return;
}
if (response && response.statusCode) {
const destination = join(__dirname, '..', 'settings', `default.json`);
writeFileSync(destination, body);
return;
}
reject('Call to minds endpoint failed');
});
\ No newline at end of file