123456789101112131415161718192021222324252627282930313233343536(**************************************************************************)(* *)(* Copyright 2020 OCamlPro & Origin Labs *)(* *)(* All rights reserved. This file is distributed under the terms of the *)(* GNU Lesser General Public License version 2.1, with the special *)(* exception on linking described in the file LICENSE. *)(* *)(**************************************************************************)letuser()=matchMisc.call_get_fst_line"git config --get user.name"with|Someuser->user|None->raiseNot_foundletemail()=matchMisc.call_get_fst_line"git config --get user.email"with|Someemail->email|None->raiseNot_foundletcallargs=Misc.call(Array.of_list("git"::args))letrunargs=trycallargswith_->()letupdate_submodules()=ifSys.file_exists".gitmodules"thenrun["submodule";"update";"--init";"--recursive"]letremovedir=Misc.call[|"rm";"-rf";dir|];run["rm";"-rf";dir]letrenameold_dirnew_dir=Misc.call[|"mv";old_dir;new_dir|];run["rm";"-rf";old_dir];run["add";new_dir]