Skip to content
Snippets Groups Projects
Commit 284dcec2 authored by Martin Santangelo's avatar Martin Santangelo
Browse files

Merge branch 'feat/default-settings-script-update' into 'release/3.9.0'

[Sprint/LuckyLIzard] (feat) update default settings script

See merge request !307
parents c648f4fe 1b7dda50
No related branches found
No related tags found
Loading
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"scripts": { "scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start", "start": "node node_modules/react-native/local-cli/cli.js start",
"validate-locales": "node tasks/validate-locales.js", "validate-locales": "node tasks/validate-locales.js",
"update-settings": "ts-node tasks/update-settings.js",
"test": "jest", "test": "jest",
"locale": "ts-node tasks/poeditor.js", "locale": "ts-node tasks/poeditor.js",
"e2e": "jest -c jest.e2e.config.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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment