-1

I try to get all filenames from codecommit repo through aws cli.

If we use command

aws codecommit get-folder --repository-name reponame --folder-path ""

we can get output like this

{
"commitId": "2915c5a2eab08aeb36facbb1dc78b7f3f6f10873",
"folderPath": "",
"treeId": "0cc6d2dcfa75acd0bceacd446674635d44be0ab7",
"subFolders": [],
"files": [
    {
        "blobId": "8e29296c9119a5c5d839bc3d910b065c5cce0629",
        "absolutePath": "filename.yaml",
        "relativePath": "filename.yaml",
        "fileMode": "NORMAL"
    }
],
"symbolicLinks": [],
"subModules": []
}

And I should get a full filename of "filename.yaml". I think I can get this through bash, but now I can't understand how it's possible. Could you please help me?

If I find an answer, I will definitely share it here.

Mykola
  • 3
  • 1

1 Answers1

0

Append this to your command:

| jq -r '.files[].absolutePath'

Output:

filename.yaml

See: man jq

Cyrus
  • 84,225
  • 14
  • 89
  • 153