Skip to content

Commit a26aeb5

Browse files
committed
Add 'Calorie_Counter/' from commit 'ec00c36ef3ca17dfd7ff7c279c554426617663e8'
git-subtree-dir: Calorie_Counter git-subtree-mainline: 668486a git-subtree-split: ec00c36
2 parents 668486a + ec00c36 commit a26aeb5

File tree

606 files changed

+49923
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

606 files changed

+49923
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/usr/bin/env node
2+
3+
const path = require("path");
4+
const { execSync } = require("child_process");
5+
6+
const util = require("node:util");
7+
const exec = util.promisify(require("node:child_process").exec);
8+
9+
const projectRoot = path.join(__dirname, "..");
10+
11+
const scriptPath = path.join(
12+
projectRoot,
13+
"automation",
14+
"ManagerREADMES",
15+
"manager_readmes.js"
16+
);
17+
18+
// const changedFiles = execSync('git diff --cached --name-only', { encoding: 'utf-8' }).trim().split(' ');
19+
// const diffedFiles = execSync('git diff --name-only' , { encoding: 'utf-8' }).trim().split(' ');
20+
// const stagedFiles = execSync('git diff --staged --name-only', { encoding: 'utf-8' }).trim().split(' ');
21+
// const newFiles = execSync('git ls-files --others --exclude-standard', { encoding: 'utf-8' }).trim().split(' ');
22+
const diffedFiles2 = execSync("git diff --name-only", { encoding: "utf-8" })
23+
.trim()
24+
.split("\n");
25+
const stagedFiles2 = execSync("git diff --staged --name-only", {
26+
encoding: "utf-8",
27+
})
28+
.trim()
29+
.split("\n");
30+
const newFiles2 = execSync("git ls-files --others --exclude-standard", {
31+
encoding: "utf-8",
32+
})
33+
.trim()
34+
.split("\n");
35+
36+
// const isRelevantChange = changedFiles.some(file => ['styles.css', 'index.html', 'script.js'].includes(path.basename(file)));
37+
// const isRelevantDiff = diffedFiles .some(file => ['styles.css', 'index.html', 'script.js'].includes(path.basename(file)));
38+
// const isRelevantStaged = stagedFiles .some(file => ['styles.css', 'index.html', 'script.js'].includes(path.basename(file)));
39+
40+
const relevantFiles = [...diffedFiles2, ...stagedFiles2, ...newFiles2].filter(
41+
(file) =>
42+
["styles.css", "index.html", "script.js"].includes(path.basename(file))
43+
);
44+
45+
46+
(async () => {
47+
if (relevantFiles.length > 0) {
48+
require(scriptPath);
49+
} else {
50+
console.log("No relevant changes detected. Skipping script execution.");
51+
}
52+
})();
53+
54+
setTimeout(() => {
55+
execSync("git add .", { stdio: "inherit" });
56+
}, 10000);

Calorie_Counter/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules/
2+
!*.html
3+
!*.png
4+
!**/*.svg
5+
6+
7+

Calorie_Counter/.gitmodules

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[submodule "automation/ManagerREADMES"]
2+
path = automation/ManagerREADMES
3+
url = https://github.com/AndriiKot/Manager_Projects__freeCodeCamp.git
4+
branch = ManagerCaloriesCounter
5+

Calorie_Counter/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 AndriiKot
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Calorie_Counter/README.md

Lines changed: 369 additions & 0 deletions
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit ac4ae1a072a6fe0103716cc9cb279c2a27c2016c
Lines changed: 1 addition & 0 deletions
Lines changed: 1 addition & 0 deletions
Lines changed: 1 addition & 0 deletions
62.6 KB

0 commit comments

Comments
 (0)