-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Supporting post install script on Windows (#12)
- Loading branch information
1 parent
d5aa135
commit 75b4ed0
Showing
4 changed files
with
35 additions
and
13 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
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,30 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
let workingDir = process.env.INIT_CWD; | ||
if (!workingDir) { | ||
workingDir = '.'; | ||
} | ||
|
||
if (!fs.existsSync(path.join(workingDir, 'android'))) { | ||
console.warn( | ||
'cannot install android-js-engine library: @capacitor/android not installed, or in wrong parent directory.', | ||
); | ||
return; | ||
} | ||
|
||
const releaseAARPath = path.join( | ||
'android/src/main/libs/android-js-engine-release.aar', | ||
); | ||
|
||
const fullPath = path.join(workingDir, 'android/app/libs'); | ||
if (!fs.existsSync(fullPath)) { | ||
fs.mkdirSync(fullPath); | ||
} | ||
|
||
fs.copyFileSync( | ||
releaseAARPath, | ||
path.join(fullPath, 'android-js-engine-release.aar'), | ||
); | ||
|
||
console.log(`copied android-js-engine-release.aar to ${fullPath}`); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.