Skip to content

Commit 4ce0baf

Browse files
committed
Fix
1 parent 0d5bcdb commit 4ce0baf

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

site/src/xServices/templateVersionEditor/templateVersionEditorXService.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,17 @@ export const templateVersionEditorMachine = createMachine(
252252
}
253253
// Add the editable files
254254
traverse(fileTree, (content, _filename, fullPath) => {
255+
// When a file is deleted. Don't add it to the tar.
256+
if (content === undefined) {
257+
return
258+
}
259+
255260
if (typeof content === "string") {
256261
tar.addFile(fullPath, content)
257-
} else {
258-
tar.addFolder(fullPath)
262+
return
259263
}
264+
265+
tar.addFolder(fullPath)
260266
})
261267
const blob = await tar.write()
262268
return API.uploadTemplateFile(new File([blob], "template.tar"))

0 commit comments

Comments
 (0)