5

Suppose I have a CodeCommit repo on AWS like this:

repo
-folder1
--file1
--folder2
---file2
---folder3
----file3
aws codecommit get-folder --folder-path "folder1"

only returns "file1" and "folder2"

Is there a way to get "file1" and "folder2/file2" and "folder2/folder3/file3" WITHOUT recursively call "get-folder" on all subfolders?

lznt
  • 2,330
  • 2
  • 22
  • 27

1 Answers1

1

There does not seem to be an SKD or CLI call to do it as of February 2023 but there is an indirect way to do it. Run the following command:

aws codecommit get-differences --repository-name YOUR_REPOSITORY_NAME --after-commit-specifier "HEAD"

It will return a list of differences between the repository's HEAD and the empty repository. In this way, it will contain the entire tree of your current repository. And if you map the returned result by differences.afterBlob.path you will get a clean list of your current repository structure.

hkdalex
  • 717
  • 7
  • 13