forked from Telerik-Verified-Plugins/ImagePicker
-
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
1 parent
f4e0f72
commit 355b20b
Showing
2 changed files
with
37 additions
and
1 deletion.
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,35 @@ | ||
var fs = require("fs"); | ||
var path = require("path"); | ||
var rootdir = process.env.PWD; | ||
var valuesPath = "/platforms/android/app/src/main/res/values/"; | ||
var themesFile = "themes.xml"; | ||
var destFile = path.join(rootdir, valuesPath, themesFile); | ||
var destDir = path.dirname(destFile); | ||
|
||
module.exports = function (context) { | ||
console.log("*************************************"); | ||
console.log(`before_plugin_install running`); | ||
console.log("*************************************"); | ||
|
||
if (fs.existsSync(destDir)) { | ||
if (!fs.existsSync(destFile)) { | ||
console.log("*************************************"); | ||
console.log(`creating new ${destFile}`); | ||
console.log("*************************************"); | ||
fs.writeFile( | ||
destFile, | ||
'<?xml version="1.0" encoding="utf-8"?>\n<resources>\n<style name="MyTheme" parent="android:Theme.Holo.Light">\n</style>\n</resources>', | ||
function (err) { | ||
if (err) { | ||
console.error("writeFile error" + err); | ||
} | ||
console.log(`${themesFile} created!`); | ||
} | ||
); | ||
} else { | ||
console.log(`skipping, file ${themesFile} exists`); | ||
} | ||
} else { | ||
console.log("skipping, android platform not found"); | ||
} | ||
}; |
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