From c451d208999b114696331dd1aabfd51b0b7f0274 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Sat, 22 Mar 2014 19:36:16 +0100 Subject: [PATCH] Adds support for git submodules during clone. --- src/babelpkg/download.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/babelpkg/download.nim b/src/babelpkg/download.nim index a753282..15681eb 100644 --- a/src/babelpkg/download.nim +++ b/src/babelpkg/download.nim @@ -34,6 +34,8 @@ proc doPull(meth: TDownloadMethod, downloadDir: string) = doCheckout(meth, downloadDir, "master") cd downloadDir: doCmd("git pull") + if existsFile(".gitmodules"): + doCmd("git submodule update") of TDownloadMethod.Hg: doCheckout(meth, downloadDir, "default") cd downloadDir: @@ -45,7 +47,8 @@ proc doClone(meth: TDownloadMethod, url, downloadDir: string, branch = "", tip = of TDownloadMethod.Git: let depthArg = if tip: "--depth 1 " else: "" # TODO: Get rid of the annoying 'detached HEAD' message somehow? - doCmd("git clone " & depthArg & branchArg & url & " " & downloadDir) + doCmd("git clone --recursive " & depthArg & branchArg & url & + " " & downloadDir) of TDownloadMethod.Hg: let tipArg = if tip: "-r tip " else: "" doCmd("hg clone " & tipArg & branchArg & url & " " & downloadDir)