Skip to content

Commit 6cfead6

Browse files
author
Gery Hirschfeld
committed
adds cordova setup
1 parent 0167d67 commit 6cfead6

File tree

2 files changed

+25
-35
lines changed

2 files changed

+25
-35
lines changed

config/init-cordova.js

Lines changed: 0 additions & 35 deletions
This file was deleted.

config/setup-mobile.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const exec = require('child_process').exec;
2+
const ncp = require('ncp').ncp;
3+
const rimraf = require('rimraf');
4+
const fs = require('fs');
5+
const path = require('path');
6+
7+
const pkg = require(path.join(process.cwd(), 'package.json'));
8+
// const cordovaTemp = path.join(process.cwd(), 'cordova');
9+
const root = path.join(process.cwd());
10+
const cmd = `cordova create cordova ${pkg.identifier} "${pkg.title}"`;
11+
12+
// Run command to create cordova in a temporary directory
13+
exec(cmd, (error) => {
14+
if (error) throw error;
15+
16+
// Remove cordovas www folder
17+
rimraf(`${root}/cordova/www`, (error) => {
18+
if (error) throw error;
19+
20+
// Create symlink www to point to dist
21+
fs.symlink(`${root}/dist`, `${root}/cordova/www`, 'dir', (error) => {
22+
if (error) throw error;
23+
});
24+
});
25+
});

0 commit comments

Comments
 (0)