Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
IR-3886: Ignore .ds_store file in resources.json (#10962)
Browse files Browse the repository at this point in the history
* chore: Exclude .ds_store files from project upload

* chore: Exclude .ds_store files from project upload
  • Loading branch information
MoizAdnan authored Aug 15, 2024
1 parent 0f5fb7e commit de14a0a
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion packages/server-core/src/projects/project/project-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1678,6 +1678,19 @@ const staticResourceClasses = [
AssetType.Prefab
]

const ignoreFiles = ['.ds_store']

/**
* Checks whether a file is to be ignored in resources.json and static-resources
* @param key
*/
export const isIgnoredFile = (key: string) => {
for (const ignoreFile of ignoreFiles) {
if (key.includes(ignoreFile)) return true
}
return false
}

/**
* Updates the local storage provider with the project's current files
* @param app Application object
Expand Down Expand Up @@ -1757,7 +1770,10 @@ export const uploadLocalProjectToProvider = async (
},
{ isDirectory: false }
)
if (!filePathRelative.startsWith(`assets/`) && !filePathRelative.startsWith(`public/`)) {
if (
(!filePathRelative.startsWith(`assets/`) && !filePathRelative.startsWith(`public/`)) ||
isIgnoredFile(filePathRelative)
) {
existingKeySet.delete(key)
continue
}
Expand Down

0 comments on commit de14a0a

Please sign in to comment.