Skip to content

Commit

Permalink
PLAT-13615: Simple version of the demo app available as a zip (#431)
Browse files Browse the repository at this point in the history
* PLAT-13615: Initial zip version of the app (linux only script)

* Minor updates to cookiecutter call

* update: remove unnecessary argument
  • Loading branch information
alaisgomes authored May 1, 2024
1 parent b3120a9 commit a10f1bf
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
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: "[email protected]"
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);

0 comments on commit a10f1bf

Please sign in to comment.