Skip to content

Commit a7cd2ec

Browse files
committed
adding small function so example wont break when starting it.
1 parent ca36679 commit a7cd2ec

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

bin/copy-to-run.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const fs = require("fs-extra");
2+
const path = require("path");
3+
4+
const location = path.join(__dirname, "../src");
5+
const destination = path.join(
6+
location,
7+
"../example/react-native-markdown-renderer"
8+
);
9+
10+
fs.remove(destination, err => {
11+
fs.copy(location, destination, err => {
12+
if (err) return console.error(err);
13+
14+
console.log("to %s ", destination);
15+
console.log("success!");
16+
});
17+
});

example/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules/
22
.expo/
33
npm-debug.*
4-
/package-lock.json
4+
/package-lock.json
5+
/react-native-markdown-renderer

example/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44
"private": true,
55
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
66
"scripts": {
7-
"start": "react-native-scripts start",
7+
"start": "node ../bin/copy-to-run.js && react-native-scripts start",
88
"eject": "react-native-scripts eject",
9-
"android": "react-native-scripts android",
10-
"ios": "react-native-scripts ios",
9+
"android": "node ../bin/copy-to-run.js && react-native-scripts android",
10+
"ios": "node ../bin/copy-to-run.js && react-native-scripts ios",
1111
"test": "node node_modules/jest/bin/jest.js --watch",
1212
"startdev": "node ../bin/watch.js"
13-
1413
},
1514
"jest": {
1615
"preset": "jest-expo"
@@ -24,7 +23,7 @@
2423
"devDependencies": {
2524
"jest-expo": "~18.0.0",
2625
"react-native-scripts": "0.0.50",
27-
"react-test-renderer": "16.0.0-alpha.12",
26+
"react-test-renderer": "16.0.0-alpha.12"
2827

2928
}
3029
}

0 commit comments

Comments
 (0)