can be compiled, syncs tree. needs check for bugs.

This commit is contained in:
Norayr Chilingarian 2020-05-09 01:19:17 +04:00
parent 7a741b509a
commit 163102bd19
15 changed files with 264 additions and 216 deletions

28
src/unix/vpkGit.Mod Normal file
View file

@ -0,0 +1,28 @@
MODULE vpkGit;
IMPORT Out, Strings, Platform, vpkEnv;
PROCEDURE pull*(url : ARRAY OF CHAR; dst : ARRAY OF CHAR);
VAR i : INTEGER;
cmd : ARRAY 120 OF CHAR;
BEGIN
cmd:= "git init ";
Strings.Append(dst, cmd);
i:=Platform.System(cmd);
cmd := "";
cmd := "git -C ";
Strings.Append(dst, cmd);
Strings.Append(" pull ", cmd);
Strings.Append(url, cmd);
i := Platform.System(cmd);
Out.Int(i, 0);
END pull;
PROCEDURE syncTree*(url: ARRAY OF CHAR);
VAR
tmp: ARRAY 256 OF CHAR;
BEGIN
vpkEnv.getTreeDir(tmp);
pull(url, tmp);
END syncTree;
END vpkGit.