5 Commits 2208034818 ... 26e6f38a85

Author SHA1 Message Date
  Moul 26e6f38a85 [fix] termcaps: unset term mode when quitting with 'ctrl + d'. 2 years ago
  Moul 1957cdb2d6 [enh] deliver.sh: prepare clean git repo and publish: 2 years ago
  Moul 8909046ac3 [enh] deliver.sh: rework some parts: 2 years ago
  Moul 62e5d5d70f [enh] add new scale. 2 years ago
  Moul cf12e44fea [mod] update delivery procedure. 2 years ago
5 changed files with 858 additions and 5 deletions
  1. 37 5
      deliver.sh
  2. 1 0
      doc/TODO.md
  3. 817 0
      doc/bareme_03_2017.html
  4. 0 0
      doc/bareme_06_2016.html
  5. 3 0
      src/keys.c

+ 37 - 5
deliver.sh

@@ -24,13 +24,20 @@ c_header="/* *******************************************************************
 /*                                                                            */
 /* ************************************************************************** */\n" 
 
-# Add 42 headers on top of source files
+question() {
+    echo $1 "[y/n]"
+    read yes
+    if [ $yes != "y" ]; then
+		return
+    fi
+}
+
 add_42_headers() {
     for file in "src"/*; do
         add_42_header "$file"
     done
     add_42_header "Makefile"
-    git st
+    git status
     git diff
     git add src Makefile
     git commit -m "[mod] add 42 headers on top of files."
@@ -45,16 +52,41 @@ add_42_header() {
         echo $c_header > $tmp
     fi
     cat $src_file >> $tmp
-    mv $tmp $src_file
+    cp $tmp $src_file
 }
 
 clean_repository() {
     make fclean
-    git rm -rf doc non_use_src leaks.sh deliver.sh
+    git rm -rf --ignore-unmatch doc non_use_src leaks.sh deliver.sh
     rm -f toto
+    question "Did you clean the Makefile?"
+    git add Makefile
     git commit -m "[mod] remove non used elements."
 }
 
-git checkout -b deliver
+prepare_git_repository() {
+    tmp_repo="/tmp/21sh_delivery"
+    rm -rf $tmp_repo
+    cp -r ../21sh $tmp_repo
+    cd $tmp_repo
+    rm -rf .git
+    git init
+    echo "What's the repository URL?"
+    read repo_url
+    git remote add origin $repo_url
+    git add .
+    git commit -m "21sh delivery"
+}
+
+ready() {
+    norminette **/**.[ch]
+    make run
+    question "Publish?"
+    git push -u origin master
+}
+
+git checkout -B deliver
 add_42_headers
 clean_repository
+prepare_git_repository
+ready

+ 1 - 0
doc/TODO.md

@@ -92,4 +92,5 @@ X [x] Placer, par ordre d’exécution, les pipes avant les redirections.
 ### Rendu
 - [ ] lancer ./deliver.sh
 - [ ] Norminette manuelle
+- [ ] nettoyer Makefile avec cmd de leaks 
 - [ ] Dépôt git de la Vogosphère

File diff suppressed because it is too large
+ 817 - 0
doc/bareme_03_2017.html


doc/new-bareme.html → doc/bareme_06_2016.html


+ 3 - 0
src/keys.c

@@ -60,7 +60,10 @@ void	handle_keys2(t_e *e, int all)
 	else if (e->key[0] == 4)
 	{
 		if (e->len == 0 || e->d == 1)
+		{
+			set_term_modes(1);
 			error_message("", "exit", "exit");
+		}
 		else if (e->d == 0)
 			e->d = 1;
 	}