Skip to content

Commit ed457e5

Browse files
authored
Setup post-init script and upgrade configuration usage
* executable post init script * post init script with instructions and copy configuration file * change instruction according to the new post init script
1 parent 6ef0911 commit ed457e5

File tree

7 files changed

+25
-14
lines changed

7 files changed

+25
-14
lines changed

Diff for: README.md

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ npx react-native init MyApp --template @thecodingmachine/react-native-boilerplat
3838
Assuming you have all the requirements installed, you can setup and run the project by running:
3939

4040
- `yarn install` to install the dependencies
41-
- create your [configuration file `App/Config/index.js`](App/Config) from `index.dev.js` (if you are in dev environment) and fill the missing values
4241
- run the following steps for your platform
4342

4443
### Android

Diff for: documentation/docs/2_Getting Started/2_1_Installation.md

-5
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,11 @@ To create a new project using the boilerplate simply run :
2020
npx react-native init MyApp --template @thecodingmachine/react-native-boilerplate
2121
```
2222

23-
:::warning
24-
If you have an error ECACCES this is not bloking, you can use it even if you have this error.
25-
:::
26-
2723
## Running the project
2824

2925
Assuming you have all the requirements installed, you can setup and run the project by running:
3026

3127
- `yarn install` to install the dependencies
32-
- create your [configuration file `src/Config/index.js`](https://github.com/thecodingmachine/react-native-boilerplate/tree/master/template/src/Config) from `index.dev.js` (if you are in dev environment) and fill the missing values
3328
- run the following steps for your platform
3429

3530
### Android

Diff for: post-init.script.js

100644100755
+23-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
11
#!/usr/bin/env node
22

3-
console.log("This is post init script");
3+
const fs = require('fs')
4+
fs.copyFile('src/Config/index.example.js', 'src/Config/index.js', (err) => {
5+
if (err) throw err;
6+
console.log('src/Config/index.example.js was copied to src/Config/index.js');
7+
});
8+
9+
console.log("TheCodingMachine React-Native Boilerplate initialized with success !");
10+
console.log("" +
11+
" .-` `:: \n" +
12+
" `///////////// `/shhhy+- ://. /sy/ /ss/ :NMN: \n" +
13+
" `sssssyhhhyhhy:` `yMMMMNNMMMd. osss: `hMMMh- .-` `+ss: +MMm/. \n" +
14+
" :MMM+----. `mMMm+:-`.oo/` osssyo` `dMMMMh- ohhh- `oyy+- sMMd/. \n" +
15+
" :MMM+` oMMN/- osssyhs`.mMMMMMh- -hds` .syy+- `hMMh:` \n" +
16+
" :MMM+` hMMd: oss-ohhhMMMhdMMh- `. +NNm/. .dMMy:` \n" +
17+
" :MMM+` oMMN/ oss-`shdMMd:dMMh- :-` sMMd/. -NMMo- \n" +
18+
" :MMM+` `mMMm/` `/+:. oss- `sdMd:.hMMh- hMys- `hMMh:` -hdy-` \n" +
19+
" :MMM+` `yMMMMdssss+ oss. `oh/- hMMh- -hyo: dMMs:` -ss+` \n" +
20+
" .oys:` .+yhyo/- -::` `` -syo- ..` +mo- `// \n" +
21+
" `` ``` `` `. ")
22+
23+
console.log('- If you need to read more about this boilerplate : https://thecodingmachine.github.io/react-native-boilerplate/')
24+
console.log('- If you have some troubles : https://github.com/thecodingmachine/react-native-boilerplate/issues')
25+
console.log('- If you love this boilerplate, give us a star, you will be a ray of sunshine in our lives :) https://github.com/thecodingmachine/react-native-boilerplate')

Diff for: template.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module.exports = {
99
// Directory with the template which will be copied and processed by React Native CLI. Template directory should have package.json with all dependencies specified, including `react-native`.
1010
templateDir: './template',
1111

12-
// Path to script, which will be executed after initialization process, but before installing all the dependencies specified in the template. This script runs as a shell script but you can change that (e.g. to Node) by using a shebang (see example custom template).
12+
// Path to script, which will be executed after initialization process, but before installing all the dependencies specified in the template.
13+
// This script runs as a shell script but you can change that (e.g. to Node) by using a shebang (see example custom template).
1314
postInitScript: './post-init.script.js',
1415
};
File renamed without changes.

Diff for: template/src/Config/index.production.js

-3
This file was deleted.

Diff for: template/src/Config/index.staging.js

-3
This file was deleted.

0 commit comments

Comments
 (0)