Skip to content

Commit

Permalink
Merge branch 'main' into tdstein/103
Browse files Browse the repository at this point in the history
  • Loading branch information
tdstein authored Sep 13, 2023
2 parents 5be263e + 398b48b commit b3da2c0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions web/src/components/panels/FilesToPublish.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const deploymentStore = useDeploymentStore();
const files = ref<QTreeNode[]>([]);
const expanded = ref<string[]>([]);

type FileInfo = Pick<DeploymentFile, 'size' | 'isEntrypoint' | 'exclusion'>;
type FileInfo = Pick<DeploymentFile, 'size' | 'isEntrypoint' | 'exclusion' | 'isFile' >;

const fileMap = ref(new Map<string, FileInfo>());

Expand All @@ -56,9 +56,14 @@ const selectedFileTotalSize = computed(() : string => {
});

const fileSummary = computed(() => {
const count = deploymentStore.files.length;
const path = deploymentStore.deployment?.sourcePath;

// Calculate the number of files that are "files" (i.e., regular files, not directories, symlinks, etc.)
const count = deploymentStore.files
.map(file => fileMap.value.get(file))
.filter(info => info?.isFile)
.length;

if (count) {
return `${count} files selected from ${path} (total = ${selectedFileTotalSize.value})`;
} else if (path) {
Expand All @@ -83,6 +88,7 @@ function populateFileMap(file: DeploymentFile) {
size: file.size,
isEntrypoint: file.isEntrypoint,
exclusion: file.exclusion,
isFile: file.isFile
};
fileMap.value.set(file.id, info);
file.files.forEach(populateFileMap);
Expand Down

0 comments on commit b3da2c0

Please sign in to comment.