Command Line Client Adding Folder Recursive

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
grandavenuesoftware
Posts: 21
Joined: Wed Feb 14, 2007 2:50 pm

Command Line Client Adding Folder Recursive

Post by grandavenuesoftware » Wed Aug 21, 2019 4:36 pm

I'm working on creating a script to snapshot our Jenkins configuration into vault so we can easily diff changes.

I've got most of it working but I'm having issues with a new folder.

When I encounter a new folder I do an ADD on the folder.
Then I do an ADD on any contained files which also seems to add a Create Folder item for the folder in the change set.

Is there a way on the command line to do something similar to Detect new files which will add the folder and all items recursively?
Grand Avenue Software

Tonya
Posts: 518
Joined: Thu Jan 20, 2005 1:47 pm
Location: SourceGear

Re: Command Line Client Adding Folder Recursive

Post by Tonya » Thu Aug 22, 2019 8:26 am

Hello,

Yes, Vault 10.x has a new feature which includes the DETECTNEW command. DETECTNEW command (and -REMOVEDUPLICATES option) allows the Command Line Client to find and add items within working folders not currently under Vault's Source Code Control.

Thanks,

Tonya

grandavenuesoftware
Posts: 21
Joined: Wed Feb 14, 2007 2:50 pm

Re: Command Line Client Adding Folder Recursive

Post by grandavenuesoftware » Thu Aug 22, 2019 11:48 am

That worked. Now I'm getting an error when I try to check in from the script.

This is the command:

CHECKIN -comment "Jenkins Config Checkpoint" -verbose -resolvemerge $repositoryPath

WARNING: <vault> <error> <exception>System.Exception: The current change set does not have any items for Config
at VaultClientIntegrationLib.ServerOperations.ProcessCommandCommit(String[] objectPaths, UnchangedHandler unchanged,
Boolean keepCheckedOut, Nullable`1 removeLocalCopy, Boolean resolveMerge, ChangeSetItemColl& csicRemove) at
VaultCmdLineClient.VaultCmdLineClient.ProcessCommand(Args curArg) at
VaultCmdLineClient.VaultCmdLineClient.Main(String[] args)</exception> </error> <result>
<success>False</success> </result> </vault>

When I run the same command after the script has failed it works just fine.

What am I doing wrong?
Grand Avenue Software

Tonya
Posts: 518
Joined: Thu Jan 20, 2005 1:47 pm
Location: SourceGear

Re: Command Line Client Adding Folder Recursive

Post by Tonya » Thu Aug 22, 2019 12:54 pm

I believe there may be an error in your command. Do you happen to know what $repositoryPath is set to? The error message indicates it is set to "Config", and is not a valid repository path.

Thanks,

Tonya

grandavenuesoftware
Posts: 21
Joined: Wed Feb 14, 2007 2:50 pm

Re: Command Line Client Adding Folder Recursive

Post by grandavenuesoftware » Thu Aug 22, 2019 2:37 pm

I figured it out. The comment lost its quotes as I passed it through, so that's where Config came from. I should be able to finish it now. Thank you very much for your excellent support! (Being in a software company, I know how hard that is to provide.)
Grand Avenue Software

Tonya
Posts: 518
Joined: Thu Jan 20, 2005 1:47 pm
Location: SourceGear

Re: Command Line Client Adding Folder Recursive

Post by Tonya » Thu Aug 22, 2019 3:04 pm

You're welcome and glad to hear the issue is resolved!

If you need further assistance, just let us know.

Tonya

Post Reply