add script

This commit is contained in:
ringabout 2022-12-15 21:21:46 +08:00
commit c6c0eb027a
2 changed files with 24 additions and 0 deletions

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
nimcache/
nimblecache/
htmldocs/

21
push_c_code.nim Normal file
View file

@ -0,0 +1,21 @@
import std/os
proc exec(cmd: string) =
if execShellCmd(cmd) != 0: quit("FAILURE " & cmd)
proc main() =
if not dirExists(".git"):
quit "[Error] no csources git repository found"
copyDir("../nimv2/build", getCurrentDir())
for kind, path in walkDir("c_code"):
if kind == pcDir:
exec("git add " & path / "*.c")
exec("git add makefile")
exec("git add *.sh")
exec("git add *.bat")
exec("git add c_code/*.h")
main()