csources_v2/push_c_code.nim
2022-12-15 21:21:46 +08:00

21 lines
No EOL
444 B
Nim

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()