aboutsummaryrefslogtreecommitdiff
path: root/hooks/apply_update.js
diff options
context:
space:
mode:
Diffstat (limited to 'hooks/apply_update.js')
-rw-r--r--hooks/apply_update.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/hooks/apply_update.js b/hooks/apply_update.js
index aa7496c..4258ee0 100644
--- a/hooks/apply_update.js
+++ b/hooks/apply_update.js
@@ -24,6 +24,8 @@
*/
module.exports = (pkg, tempDir) => {
+ let pkg2 = (twiplatform === "alicorn" ? pkg.replaceAll("_", "-").replaceAll(".", "-").split("-").map((i) => { return i.substring(0, 1).toUpperCase() + i.substring(1).toLowerCase() }).join("") : pkg)
+
const getAllDirs = function(dirPath, arrayOfFiles) {
files = fs.readdirSync(dirPath)
@@ -43,15 +45,15 @@ module.exports = (pkg, tempDir) => {
dirs = getAllDirs((home + "/packages/" + tempDir).replaceAll("\\", "/")).map(i => i.replaceAll("\\", "/").replaceAll((home + "/packages/" + tempDir).replaceAll("\\", "/") + "/", ""));
for (let dir of dirs) {
- if (!fs.existsSync(home + "/packages/" + pkg + "/" + dir)) {
- fs.mkdirSync(home + "/packages/" + pkg + "/" + dir);
+ if (!fs.existsSync(home + "/packages/" + pkg2 + "/" + dir)) {
+ fs.mkdirSync(home + "/packages/" + pkg2 + "/" + dir);
}
}
files = require('./files')(tempDir);
for (let file of files) {
if (file.trim() !== "") {
- fs.copyFileSync(home + "/packages/" + tempDir + "/" + file, home + "/packages/" + pkg + "/" + file);
+ fs.copyFileSync(home + "/packages/" + tempDir + "/" + file, home + "/packages/" + pkg2 + "/" + file);
}
}
} \ No newline at end of file