diff options
author | Minteck <contact@minteck.org> | 2022-03-27 17:56:40 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-03-27 17:56:40 +0200 |
commit | 44b4222bc02f102480d1afe05d940612ff6cb983 (patch) | |
tree | 936e6baf8039e065324cd1c2e453c33ec4cf4122 /hooks/size.js | |
parent | 1d8cbd4b6a7b654c77d8cd3793bc67811a39725d (diff) | |
download | twilight-44b4222bc02f102480d1afe05d940612ff6cb983.tar.gz twilight-44b4222bc02f102480d1afe05d940612ff6cb983.tar.bz2 twilight-44b4222bc02f102480d1afe05d940612ff6cb983.zip |
WIP Alicorn port (abandonned, To be removed)
Diffstat (limited to 'hooks/size.js')
-rw-r--r-- | hooks/size.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/hooks/size.js b/hooks/size.js index 84d9d3e..7c8ed44 100644 --- a/hooks/size.js +++ b/hooks/size.js @@ -42,7 +42,9 @@ const getAllFiles = function(dirPath, arrayOfFiles) { }
module.exports = (pkg) => {
- asize = getAllFiles((home + "/packages/" + pkg).replaceAll("\\", "/")).map(i => i.replaceAll("\\", "/").replaceAll((home + "/packages/" + pkg).replaceAll("\\", "/") + "/", "")).map(i => fs.readFileSync(home + "/packages/" + pkg + "/" + i).length).reduce((a, b) => a + b);
+ let pkg2 = (twiplatform === "alicorn" ? pkg.replaceAll("_", "-").replaceAll(".", "-").split("-").map((i) => { return i.substring(0, 1).toUpperCase() + i.substring(1).toLowerCase() }).join("") : pkg);
+
+ asize = getAllFiles((home + "/packages/" + pkg2).replaceAll("\\", "/")).map(i => i.replaceAll("\\", "/").replaceAll((home + "/packages/" + pkg2).replaceAll("\\", "/") + "/", "")).map(i => fs.readFileSync(home + "/packages/" + pkg2 + "/" + i).length).reduce((a, b) => a + b);
if (asize > 1024) {
if (asize > 1048576) {
|