Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions cookiecutter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
default_context:
project_name: "demo"
project_slug: "demo"
project_generated_name: "demo"
owner_email: "demo@crowdbotics.com"
custom_domain: "demo.botics.co"
repo_url: "https://github.com/crowdbotics/modules"
heroku_dyno_size: "free"
heroku_team: ""
is_mobile: "y"
Binary file added dist/react-native-demo.zip
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"scripts": {
"semver": "node scripts/semver.js",
"cookie": "node scripts/cookie.js",
"demo": "node scripts/demo.js",
"raw": "node scripts/raw.js",
"template": "node scripts/template.js",
"bootstrap": "npm run raw; npm run cookie",
Expand Down
33 changes: 33 additions & 0 deletions scripts/demo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import path from "path";
import { execSync } from "child_process";
import fs from "fs";

const demoPath = path.join(process.cwd(), "demo");

const options = {
encoding: "utf8",
stdio: "inherit",
cwd: path.dirname(demoPath)
};
const yaml = path.join(process.cwd(), "cookiecutter.yaml");

function removeDir(dir) {
if (fs.existsSync(dir)) {
fs.rmSync(dir, { recursive: true });
}
}

removeDir(demoPath);

const rnCookieCutterCommand = [
"pipenv run cookiecutter",
"./dist/cookie",
`--config-file ${yaml}`,
"--no-input"
].join(" ");

execSync(rnCookieCutterCommand, options);

execSync(`cd ${demoPath} && zip -r ../dist/react-native-demo.zip .`, options);

removeDir(demoPath);