Skip to content

Commit

Permalink
add merge flag to arc get
Browse files Browse the repository at this point in the history
  • Loading branch information
HLWeil committed Jul 13, 2023
1 parent 7117a76 commit 3ff8697
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/ArcCommander/APIs/GitAPI.fs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ module GitAPI =
let repoDir = GeneralConfiguration.getWorkDirectory arcConfiguration

let remoteAddress = getFieldValueByName "RepositoryAddress" gitArgs


let merge = containsFlag "Merge" gitArgs

let branch =
match tryGetFieldValueByName "BranchName" gitArgs with
| Some branchName -> $" -b {branchName}"
Expand All @@ -40,7 +42,7 @@ module GitAPI =
else
""

if System.IO.Directory.GetFileSystemEntries repoDir |> Array.isEmpty then
if merge then
log.Trace("Downloading into current folder.")
executeGitCommand repoDir $"clone {lfsConfig} {remoteAddress}{branch} ." |> ignore
else
Expand Down
3 changes: 2 additions & 1 deletion src/ArcCommander/CLIArguments/ArcArgs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,15 @@ type ArcGetArgs =
| [<Mandatory>][<Unique>][<AltCommandLine("-r")>] RepositoryAddress of repository_address:string
| [<Unique>][<AltCommandLine("-b")>] BranchName of branch_name:string
| [<Unique>][<AltCommandLine("-n")>] NoLFS
| [<Unique>][<AltCommandLine("-m")>] Merge

interface IArgParserTemplate with
member this.Usage =
match this with
| RepositoryAddress _ -> "Git remote address from which to pull the ARC"
| BranchName _ -> "Branch of the remote address which should be used. If none is given, uses \"main\""
| NoLFS _ -> "Does download only the pointers of LFS files, not the file content itself. Ideal for when you're only interested in the experimental metadata, not the data itself."

| Merge _ -> "Merges the repository into the current folder. Fails, if the current folder isn't empty."

type ArcServerArgs =
| [<Unique>][<AltCommandLine("-p")>] Port of port_address : string
Expand Down

0 comments on commit 3ff8697

Please sign in to comment.