Browse Source

[wip] add script to handle project deliver.

Moul 2 years ago
parent
commit
e293eec330
2 changed files with 71 additions and 1 deletions
  1. 70 0
      deliver.sh
  2. 1 1
      doc/TODO.md

+ 70 - 0
deliver.sh

@@ -0,0 +1,70 @@
+#!/bin/bash
+
+# Norm for ft_itoa
+norm_itoa_base() {
+    git rm -f libft/src/ft_itoa_base.c
+    ## Modifiy libft/src/ft_itoa.c
+    #sed '/char				*ft_itoa_base(int value, int base);/d' libft/libft.h
+    #sed '/ft_itoa_base\.c \/d' libft/Makefile
+    #git add libft
+#    git commit -m "[norm] remove itoa_base and use itoa."
+}
+
+# Add 42 headers on top of source files
+add_42_headers() {
+header_makefile =
+"# **************************************************************************** #
+#                                                                              #
+#                                                         :::      ::::::::    #
+#    Makefile                                           :+:      :+:    :+:    #
+#                                                     +:+ +:+         +:+      #
+#    By: mazimi <mazimi@student.42.fr>              +#+  +:+       +#+         #
+#                                                 +#+#+#+#+#+   +#+            #
+#    Created: 2017/03/04 15:35:21 by mazimi            #+#    #+#              #
+#    Updated: 2017/03/04 15:35:21 by mazimi           ###   ########.fr        #
+#                                                                              #
+# **************************************************************************** #
+
+"
+	tmp=$"/tmp/42_header"
+	echo $header_makefile > $tmp
+	cat Makefile >> $tmp
+	mv $tmp Makefile
+#	src/*.c
+#	while () {
+#	    echo $header_c > $tmp
+#	    cat src/$file >> $tmp
+#	    mv $tmp src/$file
+#        }
+#	git add .
+#	git commit -m "[mod] add 42 headers on top of files."
+
+	# Gérer le makefile
+}
+
+clean_repository () {
+    make fclean
+    git rm -rf doc non_use_src deliver.sh
+    rm -f toto
+    git commit -m "[mod] remove non used elements."
+}
+
+header_c =
+"/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   file.c                                             :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: mazimi <mazimi@student.42.fr>              +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2017/03/04 15:35:21 by mazimi            #+#    #+#             */
+/*   Updated: 2017/03/04 15:35:21 by mazimi           ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+" 
+
+git checkout -b deliver
+#norm_itoa_base
+add_42_headers
+#clean_repository

+ 1 - 1
doc/TODO.md

@@ -94,4 +94,4 @@ X [x] Placer, par ordre d’exécution, les pipes avant les redirections.
 - [ ] Shell: ajout des en-têtes
 - [ ] Libft: retrait ft_itoa_base, retrait des commentaires de ft_itoa
 - [ ] Norminette manuelle
-- [ ] Retrait dossiers 'doc' et 'non_use_src'
+- [ ] lancer ./deliver.sh