-
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.
- Loading branch information
Anders Knutsson
authored and
Anders Knutsson
committed
Sep 29, 2018
1 parent
eeca865
commit b9d3952
Showing
2 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,24 @@ | ||
const { exec } = require('child_process'); | ||
const semver = require('semver'); | ||
|
||
exec('tns --version', (err, stdout, stderr) => { | ||
if (err) { | ||
// node couldn't execute the command | ||
console.log(`tns --version err: ${err}`); | ||
return; | ||
} | ||
|
||
const tnsVersion = semver.major(stdout); | ||
|
||
// execute 'tns plugin build' for {N} version > 4. This command builds .aar in platforms/android folder. | ||
if (tnsVersion >= 4) { | ||
console.log(`executing 'tns plugin build'`); | ||
exec('tns plugin build', (err, stdout, stderr) => { | ||
if (err) { | ||
// node couldn't execute the command | ||
console.log(`${err}`); | ||
return; | ||
} | ||
}); | ||
} | ||
}); |