-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bugfix: add Props folder after running npm i
- Loading branch information
1 parent
95b420c
commit 49c738a
Showing
3 changed files
with
55 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,48 @@ | ||
const { exec } = require("child_process"); | ||
exec( | ||
"git clone https://github.com/react-native-elements/react-native-elements --depth=1", | ||
(err, stdout, stderr) => { | ||
if (err) { | ||
// node couldn't execute the command | ||
return; | ||
} | ||
const { execSync } = require("child_process"); | ||
const findRemoveSync = require("find-remove"); | ||
const cpDir = require("copy-dir"); | ||
|
||
/* | ||
* 1. find and delete any directory named react-native-elements | ||
* 2. find and delete any directory named Props | ||
* 3. clone the react-native-elements(https://github.com/react-native-elements/react-native-elements) repo | ||
* 4. copy Props folder from cloned repo into our project | ||
*/ | ||
|
||
try { | ||
// Point 1. depth=1 required (to avoid deleting node_modules/react-native-elements) | ||
let result = findRemoveSync(".", { | ||
maxLevel: 1, | ||
dir: "react-native-elements", | ||
}); | ||
console.log("✔️ Removed ?: ", result); | ||
|
||
// Point 2 | ||
result = findRemoveSync("./src/content", { dir: "Props" }); | ||
console.log("✔️ Removed ?: ", result); | ||
|
||
// the *entire* stdout and stderr (buffered) | ||
console.log(`stdout: ${stdout}`); | ||
console.log(`stderr: ${stderr}`); | ||
} | ||
); | ||
exec("cp -r ./react-native-elements/website/docs/props ./src/content/Props"), | ||
(err, stdout, stderr) => { | ||
if (err) { | ||
// node couldn't execute the command | ||
return; | ||
/* Point 3 */ | ||
execSync( | ||
"git clone https://github.com/react-native-elements/react-native-elements --depth=1", | ||
(err, stdout, stderr) => { | ||
if (err) { | ||
// node couldn't execute the command | ||
return; | ||
} | ||
// the *entire* stdout and stderr (buffered) | ||
console.log(`stdout: ${stdout}`); | ||
console.log(`stderr: ${stderr}`); | ||
} | ||
); | ||
console.log("✔️ Cloned react-native-elements"); | ||
|
||
// the *entire* stdout and stderr (buffered) | ||
console.log(`stdout: ${stdout}`); | ||
console.log(`stderr: ${stderr}`); | ||
}; | ||
// Point 4 | ||
cpDir.sync( | ||
"./react-native-elements/website/docs/props", | ||
"./src/content/Props" | ||
); | ||
console.log("✔️ Copied Props to src/content/Props"); | ||
} catch (err) { | ||
console.error(err); | ||
return; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters