-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PLAT-13615: Simple version of the demo app available as a zip (#431)
* PLAT-13615: Initial zip version of the app (linux only script) * Minor updates to cookiecutter call * update: remove unnecessary argument
- Loading branch information
1 parent
b3120a9
commit a10f1bf
Showing
4 changed files
with
44 additions
and
0 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
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 not shown.
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 |
---|---|---|
@@ -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); |