]> granicus.if.org Git - multimarkdown/commitdiff
ADDED: new_source script to automate creating foo.c and foo.h
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Mon, 29 Aug 2016 23:01:25 +0000 (19:01 -0400)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Mon, 29 Aug 2016 23:01:25 +0000 (19:01 -0400)
new_source [new file with mode: 0755]

diff --git a/new_source b/new_source
new file mode 100755 (executable)
index 0000000..4ef951f
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+FILE=$1
+
+
+cp build/template.c src/$FILE.c
+
+perl -pi -e "s/file\.c/$FILE\.c/;" -e "s/file\.h/$FILE\.h/;" src/$FILE.c
+
+
+cp build/template.h src/$FILE.h
+
+perl -pi -e "s/file\.c/$FILE\.c/;" -e "s/file\.h/$FILE\.h/;" -e "s/FILE\_/\U$FILE\_/;" src/$FILE.h