Skip to content

Commit

Permalink
[~] Update the project files by the last version of the project
Browse files Browse the repository at this point in the history
  • Loading branch information
toro-nicolas committed Jun 3, 2024
1 parent fc3a399 commit 79ce329
Show file tree
Hide file tree
Showing 281 changed files with 18,631 additions and 6,842 deletions.
96 changes: 96 additions & 0 deletions .github/push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#!/bin/bash

# Executables
executables="42sh"

# Couleur pour les messages
RED='\033[0;31m'
GREEN='\033[0;32m'
RESET='\033[0m'
BOLD='\033[1m'

# Fonction pour compter les occurrences d'un mot dans un fichier
count_occurrences() {
local word=$1
local file=$2
grep -o -i -w "$word" "$file" | wc -l
}

# Nom du fichier de résultat
file="plum_result.txt"

# Exécution du coding style checker
plum > $file

# Compter les occurrences de MAJOR, MINOR et INFO
major_count=$(count_occurrences "MAJOR" "$file")
minor_count=$(count_occurrences "MINOR" "$file")
info_count=$(count_occurrences "INFO" "$file")

# Vérifier si le fichier contient plus de 2 occurrences de MAJOR, MINOR ou INFO
if [ $major_count -gt 2 ] || [ $minor_count -gt 2 ] || [ $info_count -gt 2 ]; then
cat $file
echo -e "${RED}${BOLD}${BOLD}INTERDICTION DE PUSH:${RED}${RED} Le fichier contient des erreurs de Coding-Style !$RESET"
rm -rf $file
exit 1
else
echo -e "${GREEN}Aucune erreur de Coding-Style détecter.${RESET}"
fi

# Supprimer le fichier de résultat
rm -rf $file

# Tester la compilation
make >/dev/null 2>&1 &
pid=$!
wait $pid
if [ $? -ne 0 ]; then
echo -e "${RED}${BOLD}INTERDICTION DE PUSH:${RED} La compilation a échouée.${RESET}"
exit 1
else
echo -e "${GREEN}La compilation s'est déroulée correctement.${RESET}"
fi

# Tester
make clean >/dev/null 2>&1 &
pid=$!
wait $pid

# Check la création de l'exécutable
.github/workflows/check_program_compilation $executables >/dev/null 2>&1 &
pid=$!
wait $pid
if [ $? -ne 0 ]; then
echo -e "${RED}${BOLD}INTERDICTION DE PUSH:${RED} Les executables n'ont pas été trouvé.${RESET}"
exit 1
else
echo -e "${GREEN}Les executables ont bien été trouvé.${RESET}"
fi

# Tester les unit tests
make tests_run >/dev/null 2>&1 &
pid=$!
wait $pid
if [ $? -ne 0 ]; then
echo -e "${RED}${BOLD}INTERDICTION DE PUSH:${RED} Les tests unitaires ont échoués.${RESET}"
exit 1
else
echo -e "${GREEN}Les tests unitaires se sont déroulés correctement.${RESET}"
fi

# Vérifier la taille du repository
make fclean >/dev/null 2>&1 &
pid=$!
wait $pid
size=$(du -sm --exclude='.git' | cut -f1)
limit=50
if [ "$size" -gt "$limit" ]; then
echo -e "${RED}${BOLD}INTERDICTION DE PUSH:${RED} La taille du repository dépasse la limite autorisée ($size MB > $limit MB)${RESET}"
exit 1
else
echo -e "${GREEN}La taille du repository est inférieure à la limite autorisée ($size MB < $limit MB)${RESET}"
fi

# Push
echo -e "${GREEN}${BOLD}PUSH AUTORISÉ !${RESET}"
git push
9 changes: 9 additions & 0 deletions docs/html/md_README.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ <h1><a class="anchor" id="autotoc_md1"></a>
<li><a href="https://github.com/toro-nicolas/42sh/blob/main/README.md#compilation-%EF%B8%8F">Compilation</a></li>
<li><a href="https://github.com/toro-nicolas/42sh/blob/main/README.md#documentation-">Documentation</a></li>
<li><a href="https://github.com/toro-nicolas/42sh/blob/main/README.md#code-mandatory-">Code mandatory</a></li>
<li><a href="https://github.com/toro-nicolas/42sh/blob/main/README.md#whats-next--">What's next ?</a></li>
<li><a href="https://github.com/toro-nicolas/42sh/blob/main/README.md#contributors-">Contributors</a></li>
</ul>
<h1><a class="anchor" id="autotoc_md2"></a>
Expand Down Expand Up @@ -337,6 +338,14 @@ <h1><a class="anchor" id="autotoc_md10"></a>
<p><b>Of course, in exceptional cases, we may depart from these rules.</b> <br />
</p>
<h1><a class="anchor" id="autotoc_md11"></a>
What's next ? 🚀</h1>
<ul>
<li>Fix the latest scripting problems</li>
<li>Fix final bugs in prompt and command writing</li>
<li>Add job controls (background process, ctrl + Z, ...)</li>
<li>Add unit tests on each piece of code</li>
</ul>
<h1><a class="anchor" id="autotoc_md12"></a>
Contributors 👥</h1>
<p>For this project, we were a group of <b>5 people</b>. Here are the people in the group: <br />
</p><ul>
Expand Down
6 changes: 3 additions & 3 deletions docs/html/myshell_8h_source.html
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@
<div class="ttc" id="amyshell_8h_html_a10b66bc05a79df303aaaeeb98834bce2"><div class="ttname"><a href="myshell_8h.html#a10b66bc05a79df303aaaeeb98834bce2">replace_alias_in_line</a></div><div class="ttdeci">char ** replace_alias_in_line(char **args, node_t **alias_list)</div><div class="ttdoc">Replace the alias if it already exists.</div><div class="ttdef"><b>Definition</b> replace_alias.c:100</div></div>
<div class="ttc" id="amyshell_8h_html_a11513c688dbfe9aeed08de42429d47ed"><div class="ttname"><a href="myshell_8h.html#a11513c688dbfe9aeed08de42429d47ed">analyse_pipes</a></div><div class="ttdeci">void analyse_pipes(mysh_t *mysh, char *line)</div><div class="ttdoc">Analyse and execute the pipes.</div><div class="ttdef"><b>Definition</b> pipes.c:153</div></div>
<div class="ttc" id="amyshell_8h_html_a13606c740b5fceb2216277ad914b9556"><div class="ttname"><a href="myshell_8h.html#a13606c740b5fceb2216277ad914b9556">check_42shrc</a></div><div class="ttdeci">void check_42shrc(mysh_t *mysh)</div><div class="ttdoc">Check if the 42shrc file exists in the home directory and create it if it doesn't.</div><div class="ttdef"><b>Definition</b> config_file.c:38</div></div>
<div class="ttc" id="amyshell_8h_html_a13ac2dbdb6a34569dd8b7a2579a51a8c"><div class="ttname"><a href="myshell_8h.html#a13ac2dbdb6a34569dd8b7a2579a51a8c">is_git_repository</a></div><div class="ttdeci">void is_git_repository(void)</div><div class="ttdoc">Check if we are in a git repository and display the branch.</div><div class="ttdef"><b>Definition</b> git_repository.c:42</div></div>
<div class="ttc" id="amyshell_8h_html_a13ac2dbdb6a34569dd8b7a2579a51a8c"><div class="ttname"><a href="myshell_8h.html#a13ac2dbdb6a34569dd8b7a2579a51a8c">is_git_repository</a></div><div class="ttdeci">void is_git_repository(void)</div><div class="ttdoc">Check if we are in a git repository and display the branch.</div><div class="ttdef"><b>Definition</b> git_repository.c:57</div></div>
<div class="ttc" id="amyshell_8h_html_a13dc08c8c6e219ef3f44237574738d56"><div class="ttname"><a href="myshell_8h.html#a13dc08c8c6e219ef3f44237574738d56">add_variable</a></div><div class="ttdeci">void add_variable(mysh_t *mysh, char *name, char *value)</div><div class="ttdoc">Add a variable to the list.</div><div class="ttdef"><b>Definition</b> set.c:100</div></div>
<div class="ttc" id="amyshell_8h_html_a13ebfb22259a6feccf3c099822cddea0"><div class="ttname"><a href="myshell_8h.html#a13ebfb22259a6feccf3c099822cddea0">shell</a></div><div class="ttdeci">void shell(char **env)</div><div class="ttdoc">The shell loop.</div><div class="ttdef"><b>Definition</b> shell.c:58</div></div>
<div class="ttc" id="amyshell_8h_html_a1537fe8378f5183164bb1673dd8110ce"><div class="ttname"><a href="myshell_8h.html#a1537fe8378f5183164bb1673dd8110ce">execute_bash_file</a></div><div class="ttdeci">int execute_bash_file(mysh_t *mysh, int file, size_t size)</div><div class="ttdoc">Execute a bash file.</div><div class="ttdef"><b>Definition</b> source.c:22</div></div>
Expand Down Expand Up @@ -528,14 +528,14 @@
<div class="ttc" id="amyshell_8h_html_af060838e2c2cb6125f8f2ab5f581d10a"><div class="ttname"><a href="myshell_8h.html#af060838e2c2cb6125f8f2ab5f581d10a">exec_unsetenv</a></div><div class="ttdeci">int exec_unsetenv(mysh_t *mysh)</div><div class="ttdoc">The unsetenv builtin.</div><div class="ttdef"><b>Definition</b> unsetenv.c:56</div></div>
<div class="ttc" id="amyshell_8h_html_af15ac46a1fb124824fea079eb4e96bfa"><div class="ttname"><a href="myshell_8h.html#af15ac46a1fb124824fea079eb4e96bfa">set_new_env_var</a></div><div class="ttdeci">int set_new_env_var(mysh_t *mysh, char *var, char *value)</div><div class="ttdoc">Set a new environment variable.</div><div class="ttdef"><b>Definition</b> setenv.c:59</div></div>
<div class="ttc" id="amyshell_8h_html_af2f6934785c0f981d85fa28f2f8484c4"><div class="ttname"><a href="myshell_8h.html#af2f6934785c0f981d85fa28f2f8484c4">save_termios</a></div><div class="ttdeci">void save_termios(struct termios *saved_termios)</div><div class="ttdoc">Save terminal attributes.</div><div class="ttdef"><b>Definition</b> termios.c:19</div></div>
<div class="ttc" id="amyshell_8h_html_af687b5b0d037de4cdcc9683bf6e1aefa"><div class="ttname"><a href="myshell_8h.html#af687b5b0d037de4cdcc9683bf6e1aefa">create_history</a></div><div class="ttdeci">void create_history(mysh_t *mysh)</div><div class="ttdoc">Create the history file.</div><div class="ttdef"><b>Definition</b> history_file.c:42</div></div>
<div class="ttc" id="amyshell_8h_html_af687b5b0d037de4cdcc9683bf6e1aefa"><div class="ttname"><a href="myshell_8h.html#af687b5b0d037de4cdcc9683bf6e1aefa">create_history</a></div><div class="ttdeci">void create_history(mysh_t *mysh)</div><div class="ttdoc">Create the history file.</div><div class="ttdef"><b>Definition</b> history_file.c:44</div></div>
<div class="ttc" id="amyshell_8h_html_af6a99cd0283c93dc5b48bfb3bd57a492"><div class="ttname"><a href="myshell_8h.html#af6a99cd0283c93dc5b48bfb3bd57a492">analyse_operators</a></div><div class="ttdeci">void analyse_operators(mysh_t *mysh, char *line)</div><div class="ttdoc">Analyse the operators and execute the commands.</div><div class="ttdef"><b>Definition</b> operators.c:106</div></div>
<div class="ttc" id="amyshell_8h_html_afa428f934667b276b642785cb1409083"><div class="ttname"><a href="myshell_8h.html#afa428f934667b276b642785cb1409083">find_valid_str</a></div><div class="ttdeci">char * find_valid_str(char *str, char const *to_find)</div><div class="ttdoc">Find a valid string in a string depending on inhibitors and parentheses.</div><div class="ttdef"><b>Definition</b> parsing.c:89</div></div>
<div class="ttc" id="amyshell_8h_html_afac4a5479eb2e970027166ea262b4508"><div class="ttname"><a href="myshell_8h.html#afac4a5479eb2e970027166ea262b4508">move_cursor</a></div><div class="ttdeci">void move_cursor(int *pos, char *str, char **str2)</div><div class="ttdoc">Move the cursor.</div><div class="ttdef"><b>Definition</b> ansi.c:120</div></div>
<div class="ttc" id="amyshell_8h_html_afd292f7893c5a181b54e279d7df15fd3"><div class="ttname"><a href="myshell_8h.html#afd292f7893c5a181b54e279d7df15fd3">my_sort_alias</a></div><div class="ttdeci">void my_sort_alias(node_t **begin, int(*cmp)())</div><div class="ttdoc">sort the alias list</div><div class="ttdef"><b>Definition</b> replace_alias.c:27</div></div>
<div class="ttc" id="amyshell_8h_html_afe6b43da3ee04eae3e97b2eadb581ed7"><div class="ttname"><a href="myshell_8h.html#afe6b43da3ee04eae3e97b2eadb581ed7">globbing</a></div><div class="ttdeci">char ** globbing(char **args)</div><div class="ttdoc">Analyse if arguments are globbing.</div><div class="ttdef"><b>Definition</b> globbing.c:42</div></div>
<div class="ttc" id="amyshell_8h_html_afef2a05b26e32f82eaf1bd4a54debc6a"><div class="ttname"><a href="myshell_8h.html#afef2a05b26e32f82eaf1bd4a54debc6a">exec_command</a></div><div class="ttdeci">int exec_command(mysh_t *mysh)</div><div class="ttdoc">The exec command builtin.</div><div class="ttdef"><b>Definition</b> exec.c:73</div></div>
<div class="ttc" id="amyshell_8h_html_affcace8e6ac735e302b4d9db6b992d4c"><div class="ttname"><a href="myshell_8h.html#affcace8e6ac735e302b4d9db6b992d4c">update_path_list</a></div><div class="ttdeci">void update_path_list(mysh_t *mysh)</div><div class="ttdoc">Update the path list.</div><div class="ttdef"><b>Definition</b> environnement.c:80</div></div>
<div class="ttc" id="amyshell_8h_html_affcace8e6ac735e302b4d9db6b992d4c"><div class="ttname"><a href="myshell_8h.html#affcace8e6ac735e302b4d9db6b992d4c">update_path_list</a></div><div class="ttdeci">void update_path_list(mysh_t *mysh)</div><div class="ttdoc">Update the path list.</div><div class="ttdef"><b>Definition</b> environnement.c:79</div></div>
<div class="ttc" id="astructalias__s_html"><div class="ttname"><a href="structalias__s.html">alias_s</a></div><div class="ttdef"><b>Definition</b> myshell.h:27</div></div>
<div class="ttc" id="astructbuiltin__s_html"><div class="ttname"><a href="structbuiltin__s.html">builtin_s</a></div><div class="ttdef"><b>Definition</b> myshell.h:74</div></div>
<div class="ttc" id="astructinput__command__s_html"><div class="ttname"><a href="structinput__command__s.html">input_command_s</a></div><div class="ttdef"><b>Definition</b> myshell.h:40</div></div>
Expand Down
7 changes: 4 additions & 3 deletions docs/html/navtreedata.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ var NAVTREE =
[ "Compilation 🛠️", "md_README.html#autotoc_md8", null ],
[ "Documentation 📚", "md_README.html#autotoc_md9", null ],
[ "Code mandatory 📦", "md_README.html#autotoc_md10", null ],
[ "Contributors 👥", "md_README.html#autotoc_md11", null ]
[ "What's next ? 🚀", "md_README.html#autotoc_md11", null ],
[ "Contributors 👥", "md_README.html#autotoc_md12", null ]
] ],
[ "Data Structures", "annotated.html", [
[ "Data Structures", "annotated.html", "annotated_dup" ],
Expand All @@ -58,8 +59,8 @@ var NAVTREEINDEX =
"about_8c.html",
"include_2mylist_8h.html",
"lib_2mylist_2mylist_8h.html#a88b24da53140700204a527f910385029",
"my__malloc__strndup_8c.html#a161966d6de4894bec46cb88ca40f535b",
"myshell_8h.html#af15ac46a1fb124824fea079eb4e96bfa"
"my__malloc__strndup_8c.html",
"myshell_8h.html#af060838e2c2cb6125f8f2ab5f581d10a"
];

var SYNCONMSG = 'click to disable panel synchronisation';
Expand Down
4 changes: 2 additions & 2 deletions docs/html/navtreeindex2.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ var NAVTREEINDEX2 =
"md_README.html#autotoc_md1":[0,0],
"md_README.html#autotoc_md10":[0,7],
"md_README.html#autotoc_md11":[0,8],
"md_README.html#autotoc_md12":[0,9],
"md_README.html#autotoc_md2":[0,1],
"md_README.html#autotoc_md3":[0,2],
"md_README.html#autotoc_md4":[0,3],
Expand Down Expand Up @@ -248,6 +249,5 @@ var NAVTREEINDEX2 =
"my__malloc__strdup_8c.html":[2,0,1,2,4],
"my__malloc__strdup_8c.html#abbb1a4d9aa9e00b83013804a1cabea55":[2,0,1,2,4,0],
"my__malloc__strdup__word__array_8c.html":[2,0,1,2,5],
"my__malloc__strdup__word__array_8c.html#ac72ba880962acef29231805d93aacc22":[2,0,1,2,5,0],
"my__malloc__strndup_8c.html":[2,0,1,2,6]
"my__malloc__strdup__word__array_8c.html#ac72ba880962acef29231805d93aacc22":[2,0,1,2,5,0]
};
4 changes: 2 additions & 2 deletions docs/html/navtreeindex3.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var NAVTREEINDEX3 =
{
"my__malloc__strndup_8c.html":[2,0,1,2,6],
"my__malloc__strndup_8c.html#a161966d6de4894bec46cb88ca40f535b":[2,0,1,2,6,0],
"my__memchr_8c.html":[2,0,1,2,7],
"my__memchr_8c.html#aeff32b685c9df20745475c500c032ea7":[2,0,1,2,7,0],
Expand Down Expand Up @@ -248,6 +249,5 @@ var NAVTREEINDEX3 =
"myshell_8h.html#ae2fe39da9129e6fdcaa9b76417c4e8a2":[2,0,0,3,83],
"myshell_8h.html#ae3382f1d7553d7ab12ba436c083ae069":[2,0,0,3,60],
"myshell_8h.html#ae547754c35fc38ef36549969f4e72d06":[2,0,0,3,16],
"myshell_8h.html#af004e503e79645136b2fea089261f0c5":[2,0,0,3,9],
"myshell_8h.html#af060838e2c2cb6125f8f2ab5f581d10a":[2,0,0,3,52]
"myshell_8h.html#af004e503e79645136b2fea089261f0c5":[2,0,0,3,9]
};
1 change: 1 addition & 0 deletions docs/html/navtreeindex4.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var NAVTREEINDEX4 =
{
"myshell_8h.html#af060838e2c2cb6125f8f2ab5f581d10a":[2,0,0,3,52],
"myshell_8h.html#af15ac46a1fb124824fea079eb4e96bfa":[2,0,0,3,87],
"myshell_8h.html#af2f6934785c0f981d85fa28f2f8484c4":[2,0,0,3,84],
"myshell_8h.html#af687b5b0d037de4cdcc9683bf6e1aefa":[2,0,0,3,23],
Expand Down
Loading

0 comments on commit 79ce329

Please sign in to comment.